Am I right in thinking that this means any dagster...
# ask-community
b
Am I right in thinking that this means any dagster code to be deployed has to be compatible with this version?
šŸ¤– 1
z
I don't think your Dagster code needs to be compatible with this version - the dagster-cloud action is just calling an API to tell Dagster Cloud about your new container, it shouldn't be directly interacting with your code at all. For context, we use that action in a Python 3.8 environment, but our code runs 3.9. But I personally would like to see the python version updated for this for consistency's sake
šŸ‘ 2
b
Ah, thanks. I was expecting dagster to be on 3.10 by now!
(I just discovered this when 'match' threw a syntax error on deploy)
s
Iā€m not a cloud eng so not very familiar with what this does, but 3.8 is the lowest Python we support-- whenever we have to choose a single Python version that will be executing user code I believe we use 3.8.
But as Zach said, your code servers etc can use up to 3.11
b
Hm. I've definitely found that I had a syntax error from 'match' when trying to deploy. Swapping to if/else resolved the issue. That keyword is 3.10, which made me think this was a version issue.
s
Hi Brendan This Dockerfile is not used for your dagster code - it is just used to run the github action itself. You can pick which version of Python you want to run in Dagster Cloud. In our serverless action there's an env called
PYTHON_VERSION
that you set to the version you want here (
major.minor
only): https://github.com/dagster-io/dagster-cloud-action/blob/b38fdd8492435a226aa89ec14c765884a0860fb4/github/serverless/deploy.yml#L16 I've linked the latest github action yaml above - if you have an earlier version you can still set the python version here if you're using fast deploys, or here if you're not using the fast deploys.
b
Ah! Thanks! That's exactly what I wanted.
@Shalabh Chaturvedi I'm actually using gitlab, so it's a bit less clear how to change the python version. I basically have:
Copy code
dagster_cloud:
  stage: deploy
  image: <http://ghcr.io/dagster-io/dagster-cloud-action:0.1.26|ghcr.io/dagster-io/dagster-cloud-action:0.1.26>
  script:
    - /gitlab_action/deploy.py ./dagster_cloud.yml
I can't see anything in the
deploy.py
that would work with different python versions - is this not supported for gitlab?
s
Ah you're right. We should add a
--python-version
flag to the
deploy-python-executable
command here: https://github.com/dagster-io/dagster-cloud-action/blob/b38fdd8492435a226aa89ec14c765884a0860fb4/src/gitlab_action/deploy.py#L35. I'll work on that. In the meantime you could directly call
dagster-cloud
in your
script:
section, with the additional flag. However it does get a little verbose, specially if you handle the branch deployments.
šŸ‘ 1