-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from dagster-io/funwithcontainercontext
Add container_context to github action
- Loading branch information
Showing
17 changed files
with
24,697 additions
and
24,094 deletions.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Example with container context | ||
on: push | ||
|
||
jobs: | ||
container-context-example: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v1 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- name: Login to ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Cache Docker builds | ||
uses: satackey/[email protected] | ||
continue-on-error: true | ||
|
||
- name: Run Dagster Cloud CI/CD action | ||
# Here, use `uses: dagster-io/dagster-cloud-cicd-action/deploy@{version}` | ||
# e.g. `uses: dagster-io/dagster-cloud-cicd-action/[email protected]` | ||
uses: ./deploy | ||
with: | ||
location-file: ./example/container-context/locations.yaml | ||
dagit-url: https://elementl.dogfood.dagster.cloud/dev | ||
api-token: ${{ secrets.DAGSTER_AGENT_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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.8-slim | ||
|
||
RUN pip install \ | ||
dagster \ | ||
dagster-cloud | ||
|
||
WORKDIR /opt/dagster/app | ||
|
||
COPY repo.py /opt/dagster/app |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Minimal Example | ||
|
||
This is a minimal example of a repo set up to use the CI/CD Action. The [`locations.yaml`](./locations.yaml) file | ||
specifies to build the `github_action_demo_minimal` code location using the Dockerfile in the current | ||
directory, using `repo.py` as an entry point. | ||
|
||
The GitHub actions workflow for this example can be found at | ||
[`.github/workflows/example-minimal.yml`](../../.github/workflows/example-minimal.yml). |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
locations: | ||
github_action_demo_container_context: | ||
build: . | ||
registry: 764506304434.dkr.ecr.us-west-2.amazonaws.com/github-action-demo-container-context | ||
python_file: repo.py | ||
container_context: | ||
docker: | ||
env_vars: | ||
- BAR_ENV_VAR=bar |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from dagster import Field, RunRequest, StringSource, job, op, repository | ||
|
||
|
||
@op( | ||
config_schema={ | ||
"must_be_bar": Field( | ||
StringSource, | ||
) | ||
}, | ||
) | ||
def foo_op(context): | ||
must_be_bar = context.op_config["must_be_bar"] | ||
if must_be_bar != "bar": | ||
raise Exception(f"Job fails if must_be_bar is not bar, instead was {must_be_bar}") | ||
|
||
|
||
@op() | ||
def foo_op_2(_): | ||
pass | ||
|
||
|
||
@job | ||
def foo_job(): | ||
foo_op() | ||
foo_op_2() | ||
|
||
|
||
@job | ||
def other_foo_job(): | ||
foo_op() | ||
|
||
|
||
@repository | ||
def foo_repo(): | ||
return [foo_job, other_foo_job] |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
dagster==0.12.14 | ||
dagster-cloud==0.12.14 | ||
dagster | ||
dagster-cloud |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.