Skip to content

Commit 45dd1aa

Browse files
authored
Merge pull request #49 from earthcube/dev
Merge in Dave's work in earthcube scheduler, dev to dev
2 parents 50a3ad1 + 2cddc33 commit 45dd1aa

File tree

1,062 files changed

+6621
-189281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,062 files changed

+6621
-189281
lines changed

.github/workflows/contanerize.yaml

+43-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ on:
99
branches:
1010
- main
1111
- dev
12+
- dv_dev
1213
- dev_eco
13-
# - dev_dagster142
14+
- v0_generated_code
15+
- 133_dev_sitemaps
16+
- 151-integrate-community-stats-codes
1417
tags:
1518
- "v*.*.*"
1619

@@ -154,7 +157,44 @@ jobs:
154157
type=ref,event=branch
155158
type=semver,pattern={{version}}
156159
type=sha
157-
160+
build_code_workflows:
161+
name: Dockerize Scheduler Workflows base
162+
runs-on: ubuntu-latest
163+
#strategy:
164+
#matrix:
165+
# project: [ "eco" ]
166+
#project: [ "eco", "iow", "oih" ]
167+
#platform: ["linux/amd64","linux/arm64"]
168+
#platform: ["linux/amd64"] #linux/arm64 issues with building
169+
steps:
170+
- name: Set variables
171+
run: |
172+
REGISTRY_IMAGE=nsfearthcube/dagster-gleanerio-workflows
173+
echo "REGISTRY_IMAGE=$REGISTRY_IMAGE" >> $GITHUB_ENV
174+
working-directory: /
175+
- name: Checkout Repo
176+
uses: actions/checkout@v3
177+
- name: Set up QEMU
178+
uses: docker/setup-qemu-action@v2
179+
- name: Set up Docker Buildx
180+
uses: docker/setup-buildx-action@v2
181+
- name: Login to DockerHub
182+
uses: docker/login-action@v2
183+
with:
184+
username: ${{ secrets.DOCKERHUB_USERNAME }}
185+
password: ${{ secrets.DOCKERHUB_TOKEN }}
186+
- name: Extract metadata (tags, labels) for Docker
187+
id: meta
188+
uses: docker/metadata-action@v4
189+
with:
190+
images: ${{ env.REGISTRY_IMAGE }}
191+
flavor: |
192+
latest=true
193+
tags: |
194+
type=ref,event=tag
195+
type=ref,event=branch
196+
type=semver,pattern={{version}}
197+
type=sha
158198
# - name: Set up Python 3.10
159199
# uses: actions/setup-python@v4
160200
# with:
@@ -201,7 +241,7 @@ jobs:
201241
build-args:
202242
implnet=${{ matrix.project }}
203243
#file: ./dagster/implnets/build/Dockerfile
204-
file: ./build/Dockerfile_code
244+
file: ./build/Dockerfile_workflows
205245
context: "{{defaultContext}}:dagster/implnets"
206246
tags: ${{ steps.meta.outputs.tags }}
207247
# tags: nsfearthcube/ec_facets_client:latest

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ venv/**
88
/dagster/.telemetry/
99
/dagster/.telemetry/
1010
.env
11+
12+
/dagster/implnets/generatedCode/implnet-*/output/
13+
14+
/dagster/implnets/deployment/prod.env
15+
16+
**/tmp**
17+
/dagster/dagster_home/

.idea/misc.xml

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scheduler.iml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NOTES.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Notes
22

3+
need to do dynamic ops.assets
4+
https://medium.com/@thegreat.rashid83/dagster-sensors-partition-c7a5205d4c0d
5+
36
## Development
47

58
At the top level (dagster/implents) you can run
@@ -28,3 +31,11 @@ will run just the task, and in editable form, i think.
2831
## Some articles to review
2932

3033
[Medium on Dagster with configurable API and asset examples](https://medium.com/@alexandreguitton_12701/notes-1-2-dagster-data-orchestrator-hands-on-2af6772b13d9)
34+
35+
## Troubleshooting.
36+
Keep the python versions in the DOCKER definitions in sync. GRPCC can be finicky
37+
38+
aka:
39+
40+
`FROM python:3.11-slim`
41+

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ structured data on the web.
1010

1111
Details of the approach can be found in the [github io](https://earthcube.github.io/scheduler/).
1212

13+
NOTE: Generate code brach v0_generated_code branch
14+
This is the original code that utilized a generate code approach to build the workflows.
15+
v0_generated_code is where gleaner and nabu config file updates should be done when using the original code
1316

1417

dagster/dagster_home/.gitkeep

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a place where dagster.yamls can be kept for runs

dagster/dagster_home/dagster.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
local_artifact_storage:
2+
module: dagster.core.storage.root
3+
class: LocalArtifactStorage
4+
config:
5+
base_dir: /Users/valentin/development/dev_earthcube/scheduler/dagster/dagster_home/
6+
run_coordinator:
7+
module: dagster.core.run_coordinator
8+
class: QueuedRunCoordinator
9+
config:
10+
max_concurrent_runs: 6
11+
# getting tags by copying from UI
12+
tag_concurrency_limits:
13+
- key: "ingest"
14+
value: "docker"
15+
limit: 3
16+
- key: "ingest"
17+
value: "report"
18+
limit: 2
19+
- key: "tenant_load"
20+
value: "graph"
21+
limit: 1
22+
telemetry:
23+
enabled: false

dagster/implnets/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
.SHELLFLAGS += -e
33
VERSION :=`cat VERSION`
44

5+
# ---- workflows ----
6+
# no code generation is neede for workflows
7+
8+
wf-build:
9+
podman build --tag="docker.io/fils/dagster_wf:$(VERSION)" --build-arg implnet=eco --file=./build/Dockerfile_workflows .
10+
11+
wf-push:
12+
podman push docker.io/fils/dagster_wf:$(VERSION)
513

614
# ---- ECO ----
715

dagster/implnets/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.67
1+
0.1.0

dagster/implnets/__init__.py

Whitespace-only changes.

dagster/implnets/build/Dockerfile_code

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ RUN mkdir -p /usr/src/app/workflows
1212

1313
RUN pip install --upgrade pip
1414
## this is a base for the project. Build this 'layer' first
15-
COPY ./requirements_code.txt requirements.txt
15+
COPY ./requirements.txt requirements.txt
1616
RUN pip install -r requirements.txt
1717

1818
# this add the code
19+
# this is only needed because we generate the code with pygen. otherwise added in compose-project.yaml docker compose
1920
COPY . scheduler
2021
COPY ./configs/${implnet}/gleanerconfig.yaml scheduler/gleanerconfig.yaml
2122

dagster/implnets/build/Dockerfile_local

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ WORKDIR /usr/src/app
2525
ENV DAGSTER_HOME=/usr/src/app
2626

2727

28-
CMD ["dagster-webserver", "-w", "./project/${implnet}/workspace.yaml", "-h", "0.0.0.0", "-p", "3000"]
28+
CMD [ "dagster", "api","grpc", "-h", "0.0.0.0", "-p", "4000", "-m", "workflows.tasks.tasks", "-d", "/usr/src/app/"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM python:3.11-slim
2+
3+
4+
# this file no longer needs to generate code. It will just include the base
5+
# it will run ingest by default
6+
# we may want to get an unreleased version of code, so this is needed
7+
8+
RUN apt-get update && apt-get install -y git
9+
RUN pip install --upgrade pip
10+
RUN apt-get install -y gcc musl-dev python3-dev
11+
#RUN apt-get install libffi-dev
12+
# Read the ARG implnet to set who to build for.
13+
14+
# docker buildandpush pulls the repo, so we need to put the code at a different location
15+
# this fails becaus the dagster/implnets files are not in the docker
16+
ARG implnet=eco
17+
18+
RUN mkdir -p /usr/src/app/workflows
19+
20+
21+
## this is a base for the project. Build this 'layer' first
22+
COPY ./requirements.txt requirements.txt
23+
RUN pip install -r requirements.txt
24+
25+
# this add the code
26+
COPY . scheduler
27+
#COPY ./configs/${implnet}/gleanerconfig.yaml scheduler/gleanerconfig.yaml
28+
29+
COPY ./deployment/dagster.yaml /usr/src/app/
30+
31+
WORKDIR scheduler
32+
33+
34+
COPY ./workflows/ /usr/src/app/workflows
35+
36+
37+
38+
# Change working directory
39+
WORKDIR /usr/src/app
40+
ENV DAGSTER_HOME=/usr/src/app
41+
42+
43+
CMD [ "dagster", "api","grpc", "-h", "0.0.0.0", "-p", "4000", "-m", "workflows.tasks.tasks", "-d", "/usr/src/app/"]

dagster/implnets/configs/a_test/headless/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)