CircleCI-Public / python-orb

Common CircleCI tasks for the Python programming language.
https://circleci.com/developer/orbs/orb/circleci/python
MIT License
13 stars 37 forks source link

Docker Image is not Pinned #50

Closed apeschel closed 4 years ago

apeschel commented 4 years ago

Orb version:

1.0.0

What happened:

Because this orb uses the floating image tag cimg/python:3.8 rather than a stable pinned tag, the orb suddenly stopped working, despite being on the same orb version. This was due to the project having a python-version file that was different from the python version pushed to the cimg/python:3.8 tag.

Expected behavior:

The behavior of a specific orb version should remain stable over time. This requires that the orb use a stable image tag for the underlying Docker image.

Additional Information:

The docker image appears to use a convention of 3 digit version tags being stable. This orb could be updated to use the cimg/python:3.8.5 or cimg/python:3.8.6 tag instead of the floating tag.

apeschel commented 4 years ago

As a side note, if there's an easy way to configure the image to use with the orb as a workaround, I could use that info at the moment.

gmemstr commented 4 years ago

Ideally, if you rely on a specific patch version of Python, it should be passed along in the executor stanza. I've deferred this to resident Python guru @dsayling for more input, but the way we handle the Docker image versioning is in-line with our other orbs (pinning to latest minor, for example within our Node orb).

dsayling commented 4 years ago

@apeschel this is by design. The orb executor is currently tied to a minor version of python which should provide no issues with backward compatiblity as new subminor versions are released (in this case 3.8.6 was recently released). We don't want to update the orb every time there is a new subminor change (this was the same reason for doing this in the other orbs, i.e. in the node orb as @gmemstr points out). When 3.9 comes out later in the fall, we may bump to that with a orb version change as well.

For now, as you said, there are ways to set the version. In the job there's a version/tag parameter:

  version:
    default: '3.8'
    description: >
      A full version tag must be specified. Example: "3.8"

      For a full list of releases, see the following:
      https://hub.docker.com/r/cimg/python
    type: string

For command usage where you are using the executor in your config like this

         executor: python/default

there is also a parameter for the version/tag that you can set.

          executor:
            name: python/default
            tag: 3.8.6
apeschel commented 4 years ago

@gmemstr @dsayling Your explanation makes sense to me. I very much appreciate your feedback on this, thank you!