Regardless of the type of app we’re shipping, a CI/CD pipeline gives us an automated, repeatable way to build, test, and package or deploy our app. Managing native Python dependencies in a CI/CD pipeline for multiple platforms can be very time-consumingįor any application that we need to ship to end users, setting up a CI/CD pipeline is a good idea. We can manually install and update our dependencies (which takes time and effort) or use a modern package manager to set up an automated and repeatable CI/CD pipeline. Fortunately, there are a couple of ways to get the job done. With enough trial and error, though, we can usually make them work on our development machines.īut what if we need to build our app’s native dependencies for multiple platforms in our CI/CD pipeline? It’s a common enough requirement, but it can be difficult to figure out where to start. Many of us are Python developers with little or no background in setting up and using native build toolchains. īuilding native dependencies from scratch has its challenges. Coding our own dependencies is a great way to ensure the security of our software supply chain. Additionally, our employer’s security policy may require us to build dependencies from scratch to ensure we’re not using a compromised native dependency. Of course, we can’t always count on the availability of pre-built wheels for our target platform. However, this method only works well if the library offers a pre-built binary wheel on PyPI for our platform - and we’re willing to trust someone else’s binary. This approach may even be appropriate for some libraries, such as TensorFlow or NumPy, that contain substantial amounts of native C, C++, or Fortran code. When we add requirements.txt to source control, we can easily use it to get our Python apps up and running on other developers’ machines, in CI/CD pipelines, and in production. Ideally, this would let us execute a single command to make our application ready to run - and as an added benefit, this makes the process repeatable. We can clear up confusion about our project’s dependencies and make them easy to install by listing them in a requirements.txt file. Scaling requires an automated CI/CD pipeline to make installing these dependencies repeatable. This may work - if we’re the only ones working on this project and we only intend to run it on our development machine - but it doesn’t scale. Setting up a Python project can be as easy as using pip to install all the dependencies we need before we can start. ![]() Application dependencies are like a city’s drainage system: when properly built and well managed, they become invisible in the apps we build, and we forget about them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |