Rusty Zarse
03/22/2023, 3:43 PMdagster_cloud.yaml
?
├── dagster
│ ├── example_project
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── assets.py
│ ├── example_project_tests
│ │ ├── __init__.py
│ │ └── test_assets.py
│ ├── pyproject.toml
│ ├── requirements.txt
│ ├── setup.py
├── dagster_cloud.yaml
├── some_other_project
│ ├── ...
├── doc
│ ├── ...
Please also critique any structure misunderstanding I may have in configuring this project. We do not plan to support multiple versions of Python within our implementation at this time.
#setup.py
from setuptools import find_packages, setup
setup(
name="optios-dagster",
packages=find_packages(exclude=["*_tests"]),
install_requires=[
"dagster",
"dagster-cloud",
"boto3",
"pandas",
"matplotlib",
],
extras_require={"dev": ["dagit", "pytest", "requests-mock"]},
)
#pyproject.toml
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.dagster]
module_name = "example_project"
Rusty Zarse
03/22/2023, 3:55 PMdagster dev
from the dagster subdirectory successfully. Ideally, I'd also like to configure dagster dev
to run without parameters from the repository root, just to be consistent with production. That is not required, however (particularly if you tell me that's not how cloud works)prha
03/22/2023, 5:28 PMdagster_cloud.yaml
file to map code locations to the source directory you’re trying to deploy: https://docs.dagster.io/concepts/code-locations#cloud-deploymentRusty Zarse
03/22/2023, 5:30 PMRusty Zarse
03/22/2023, 5:32 PMprha
03/22/2023, 5:35 PMcode_source
attribute) for each location config but I believe each location will by default look for pyproject.toml
file.Rusty Zarse
03/22/2023, 6:00 PMRusty Zarse
03/23/2023, 9:44 PM.
├── README.md
├── dagster <-- sub directory
├── README.md
└── data_orchestration <-- code location root
├── README.md
├── data_orchestration
│ ├── __init__.py
│ │ └── __init__.cpython-38.pyc
│ └── assets
│ ├── README.md
│ ├── __init__.py
│ │ └── __init__.cpython-38.pyc
│ ├── example
│ │ ├── README.md
│ │ ├── __init__.py
│ │ └── hackernews_assets.py
│ └── trade
├── data_orchestration_tests
│ ├── __init__.py
│ └── example_tests
│ └── test_example.py
├── orchestration_utils
│ └── orchestration_utils
├── pyproject.toml
├── requirements.txt <-- requirements for code location
├── setup.cfg
└── setup.py <-- module definition
├── dagster_cloud.yaml
└── util
dagster_cloud.yaml
locations:
- location_name: data_orchestration
code_source:
working_directory: dagster
module_name: data_orchestration.data_orchestration
The following, run from the root of the git repos source, works great
dagster dev -m data_orchestration.data_orchestration -d dagster
When executing the branch deploy github action (lifted from project_feature_complete), it reports
Building Python executable for data_orchestration from directory /home/runner/work/neuroedge/neuroedge/source_root/. and Python 3.8.
I expect the path to be:
/home/runner/work/neuroedge/neuroedge/source_root/dagster/.
How can I configure dagster_cloud.yaml so the code location loads the requirements.txt file from a subdirectory (dagster
) of the repo source?prha
03/23/2023, 10:22 PMcode_source
references where to find the definitions from the image that is deployed. the build
property determines how that image is built and deployed, relative to the git repository. You might find this guide (specific to github) to be helpful: https://docs.dagster.io/dagster-cloud/developing-testing/branch-deployments/using-branch-deployments-with-github#step-3-add-githu[…]-your-repositoryRusty Zarse
04/03/2023, 3:19 PM<https://github.com/dagster-io/dagster-cloud-action|dagster-io/dagster-cloud-action>
(Github Action) upon source control triggers defined in the GitHub workflows. Its essentially automating the deployment described using the Dagster CLI tool using GitHub CI Actions.
To host Dagster in a sub-directory of a monorepo, simply place the Dagster project code in whatever subdirectory fits the directory structure strategy, including dagster_cloud.yaml
and configure the GitHub Action to point to the config file in that directory. Specifically, configure dagster_cloud_file
with the correct sub-directory path to the _dagster_cloud.yaml_ file.
For example, if the Dagster project root is in the sub directory tools/dagster_orchestration
, configure the following in both:
• .github/workflows/dagster_branch_deployments.yml
• .github/workflows/dagster_deploy.yml
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/tools/dagster_orchestration/dagster_cloud.yaml"
Note that the "project-repo" sub-directory is established by the checkout task with
- name: Checkout
...
path: project-repo # <-- places source code in the sub-directory project-repo
Avoid naming a sub-directory dagster
as that may conflict with the dagster
library packageRusty Zarse
04/03/2023, 3:47 PMSean Lopp
04/03/2023, 3:55 PMPedram Navid
04/18/2023, 10:02 PM