Brian Pohl
06/14/2023, 4:28 PMDAGSTER_CLOUD_GIT_SHA
environment variable is perfect for my needs, except i need the temporary merge commit that is made against my base branch, rather than the commit i made and pushed. all my other deployment processes use GITHUB_SHA
- this page talks about how GITHUB_SHA
is this merge commit.
i have tried everything i can think of, including peeking inside the deploy code called by the CLI. but the DAGSTER_CLOUD_GIT_SHA
is always the one I pushed - the one you can see on the PR page.
i don’t necessarily need to change DAGSTER_CLOUD_GIT_SHA
- instead if you could help me pass GITHUB_SHA
into my Dagster deployment, that’d work too! But so far I have not had luck passing build arguments into my Docker image and setting them as env variables. (side question: should i expect that env variables set in my Docker image would be accessible in my @repository
description?)
for reference, my deployment Github workflow looks very much like this one. any ideas how i can access that sha and set it as an env variable? thanks!Zach
06/14/2023, 5:47 PMBrian Pohl
06/14/2023, 6:00 PMZach
06/14/2023, 6:07 PMZach
06/14/2023, 6:07 PMdagster-cloud workspace update-location ...
Brian Pohl
06/14/2023, 6:09 PMci set-build-output --location-name=${{ matrix.location.name }} --image-tag=$IMAGE_TAG-${{ matrix.location.name }}
i don’t know this command well - is there another argument i can pass that overrides the sha?Brian Pohl
06/14/2023, 6:11 PMZach
06/14/2023, 6:12 PMBrian Pohl
06/14/2023, 6:13 PM@repository
and @job
Python scripts. i’m passing it into the Docker image and i think that should do the trickZach
06/14/2023, 6:14 PM- name: Build and push fini Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
builder: ${{ steps.buildx.outputs.name }}
tags: "${{ env.IMAGE_REGISTRY }}:${{ github.sha }}"
labels: |
branch=${{ github.ref_name }}
...
Zach
06/14/2023, 6:14 PMBrian Pohl
06/14/2023, 6:17 PM- name: Build and upload Docker image for ${{ matrix.location.name }}
if: steps.prerun.outputs.result != 'skip'
uses: docker/build-push-action@v4
with:
context: ./process
push: true
tags: ${{ env.IMAGE_REGISTRY }}:${{ env.IMAGE_TAG }}-${{ matrix.location.name }}
build-args: |
DYNAMO_TABLE_MAPPING={{ env.DYNAMO_TABLE_MAPPING }}
(Dynamo table mapping is an unrelated thing, but same concept - it requires passing an env var in)
my question on that note is, am i going down the right road? if i keep fighting the build arguments and get them to work, would my jobs be able to access it?Zach
06/14/2023, 6:17 PMZach
06/14/2023, 6:18 PMZach
06/14/2023, 6:18 PMBrian Pohl
06/14/2023, 6:20 PMdaniel
06/14/2023, 7:35 PMBrian Pohl
06/14/2023, 7:37 PM