-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an env switch to both workflows that enable the new pex based workflows #23
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
31331d0
Add dagster_build_deploy_pex.yml
shalabhc 462f4f2
Delete branch_deployments.yml
shalabhc f3d3060
Delete deploy.yml
shalabhc 71a80ca
Point to the pex-testing branch of dagster-cloud-action
shalabhc eaf6557
Rename workflow to deploy.yml
shalabhc 03ca53c
Pin to a specific base image
shalabhc 3c022ca
Move env location
shalabhc 4319d50
Pass the github token when invoking the deploy workflow
shalabhc 4c55fba
Merge branch 'dagster-io:main' into main
shalabhc 46fdd41
Merge in original deploy.yml
shalabhc 8cf98c8
remove dup code
shalabhc 84edec8
rename
shalabhc f7d7bbc
add branch_deployments.yml
shalabhc 17c491b
Merge pull request #1 from dagster-io/shalabhc-merge-deploy-yml
shalabhc 3095404
Rename code overlay to python executable
shalabhc 2cf601f
Merge pull request #2 from dagster-io/rename-python-exe
shalabhc 14b20c3
Change referenced tag to @pex-v0.1
shalabhc a741415
Fix tag references - switched the wrong one
shalabhc c1be31d
Checkout github.head_ref instead of github.sha for the pex based flows
shalabhc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,31 +6,51 @@ concurrency: | |
# Cancel in-progress runs on same branch | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
DAGSTER_CLOUD_URL: ${{ secrets.DAGSTER_CLOUD_URL }} | ||
DAGSTER_CLOUD_API_TOKEN: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }} | ||
|
||
jobs: | ||
parse_workspace: | ||
dagster_cloud_default_deploy: | ||
name: Dagster Serverless Deploy | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build_info: ${{ steps.parse-workspace.outputs.build_info }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Parse cloud workspace | ||
if: env.ENABLE_PYTHON_EXECUTABLE != 'true' | ||
id: parse-workspace | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
dagster_cloud_file: dagster_cloud.yaml | ||
|
||
dagster_cloud_build_push: | ||
- name: Checkout | ||
if: env.ENABLE_PYTHON_EXECUTABLE == 'true' | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.sha }} | ||
path: project-repo | ||
|
||
- name: Build and deploy Python executable | ||
if: env.ENABLE_PYTHON_EXECUTABLE == 'true' | ||
uses: dagster-io/dagster-cloud-action/actions/[email protected] | ||
with: | ||
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/dagster_cloud.yaml" | ||
build_output_dir: "$GITHUB_WORKSPACE/build" | ||
python_version: "3.8" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
dagster_cloud_docker_deploy: | ||
name: Dagster Serverless Docker Deploy | ||
runs-on: ubuntu-latest | ||
needs: parse_workspace | ||
name: Dagster Serverless Deploy | ||
if: needs.dagster_cloud_default_deploy.outputs.build_info | ||
needs: dagster_cloud_default_deploy | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
location: ${{ fromJSON(needs.parse_workspace.outputs.build_info) }} | ||
location: ${{ fromJSON(needs.dagster_cloud_default_deploy.outputs.build_info) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -46,3 +66,4 @@ jobs: | |
organization_id: ${{ secrets.ORGANIZATION_ID }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,26 +13,46 @@ env: | |
DAGSTER_CLOUD_API_TOKEN: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }} | ||
|
||
jobs: | ||
parse_workspace: | ||
dagster_cloud_default_deploy: | ||
name: Dagster Serverless Deploy | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build_info: ${{ steps.parse-workspace.outputs.build_info }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Parse cloud workspace | ||
if: env.ENABLE_PYTHON_EXECUTABLE != 'true' | ||
id: parse-workspace | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@pex-v0.1 | ||
with: | ||
dagster_cloud_file: dagster_cloud.yaml | ||
|
||
dagster_cloud_build_push: | ||
- name: Checkout | ||
if: env.ENABLE_PYTHON_EXECUTABLE == 'true' | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.sha }} | ||
path: project-repo | ||
|
||
- name: Build and deploy Python executable | ||
if: env.ENABLE_PYTHON_EXECUTABLE == 'true' | ||
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@pex-testing | ||
with: | ||
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/dagster_cloud.yaml" | ||
build_output_dir: "$GITHUB_WORKSPACE/build" | ||
python_version: "3.8" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
dagster_cloud_docker_deploy: | ||
name: Dagster Serverless Docker Deploy | ||
runs-on: ubuntu-latest | ||
needs: parse_workspace | ||
name: Dagster Serverless Deploy | ||
if: needs.dagster_cloud_default_deploy.outputs.build_info | ||
needs: dagster_cloud_default_deploy | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
location: ${{ fromJSON(needs.parse_workspace.outputs.build_info) }} | ||
location: ${{ fromJSON(needs.dagster_cloud_default_deploy.outputs.build_info) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -48,3 +68,4 @@ jobs: | |
organization_id: ${{ secrets.ORGANIZATION_ID }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than combining the steps into a single job, can we put the condition on the job itself and then have 3 top-level jobs?
e.g.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I tried first, but unfortunately it is not possible to access
env
in the job level. It is only available in steps. actions/runner#1189 (comment)I looked for other possible ways to use a variable that can be used to switch the job, but there doesn't seem to be any.
Maybe we could create a new 'switcher' job that runs first and writes a job output which is then used in subsequent job's
if
, but running another job adds another 10s to spin up a new container so not sure if it is worth it.