-
Notifications
You must be signed in to change notification settings - Fork 4
250 lines (243 loc) · 9.1 KB
/
contanerize.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: Dockerize Dagster
# this will build based on what is committed to the branch
# dockerbuildandpush pulls the repo.
# overwrites any files created.
on:
workflow_dispatch:
push:
# be wary of using ** for the branch...
# it will fail, and only pull the main branch... which means old code, usually
branches:
- main
- dev
- dev_df
tags:
- "v*.*.*"
# https://github.com/marketplace/actions/publish-docker
# https://github.com/docker/build-push-action
defaults:
run:
working-directory: dagster/implnets
jobs:
build:
name: Dockerize Scheduler
runs-on: ubuntu-latest
strategy:
matrix:
# project: [ "eco" ]
project: [ "eco", "iow", "oih" ]
#platform: ["linux/amd64","linux/arm64"]
#platform: ["linux/amd64"] #linux/arm64 issues with building
steps:
- name: Set variables
run: |
REGISTRY_IMAGE=fils/dagster-gleanerio
echo "REGISTRY_IMAGE=$REGISTRY_IMAGE" >> $GITHUB_ENV
working-directory: /
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=true
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
# - name: Set up Python 3.10
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# long version with lint,
# run: |
# python -m pip install --upgrade pip
# pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# pip install build
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Build package
# run: python -m build
# - name: Build tooling
# run: |
# cd ./tooling/cfgBuilder/${{ matrix.project }}
# python cfgBuilder.py -s https://foo.us/sitemap.xml
# - name: Generate
# working-directory: dagster/implnets
# run: |
# python pygen.py -cf ./configs/${{ matrix.project }}/gleanerconfig.yaml -od /temp/generatedDocker/implnet-${{ matrix.project }}/output -td ./templates/v1 -d 7
# - name: check
# working-directory: dagster/implnets
# run: |
# cat ./generatedCode/implnet-${{ matrix.project }}/output/ops/implnet_ops_amgeo.py
- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
#context: ./dagster/implnets
# grr https://github.com/docker/build-push-action#git-context
#context: "{{defaultContext}}"
push: true
build-args:
implnet=${{ matrix.project }}
#file: ./dagster/implnets/build/Dockerfile
file: ./build/Dockerfile_dagster
context: "{{defaultContext}}:dagster/implnets"
tags: ${{ steps.meta.outputs.tags }}
# tags: fils/ec_facets_client:latest
labels: ${{ steps.meta.outputs.labels }}
#platforms: ${{ matrix.platform }}
#outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Image digest
run: echo ${{ steps.build.outputs.digest }}
build_code:
name: Dockerize Scheduler CODE for Project
runs-on: ubuntu-latest
strategy:
matrix:
# project: [ "eco" ]
project: [ "eco", "iow", "oih" ]
#platform: ["linux/amd64","linux/arm64"]
#platform: ["linux/amd64"] #linux/arm64 issues with building
steps:
- name: Set variables
run: |
REGISTRY_IMAGE=fils/dagster-gleanerio-${{ matrix.project }}
echo "REGISTRY_IMAGE=$REGISTRY_IMAGE" >> $GITHUB_ENV
working-directory: /
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=true
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
build_code_workflows:
name: Dockerize Scheduler Workflows base
runs-on: ubuntu-latest
#strategy:
#matrix:
# project: [ "eco" ]
#project: [ "eco", "iow", "oih" ]
#platform: ["linux/amd64","linux/arm64"]
#platform: ["linux/amd64"] #linux/arm64 issues with building
steps:
- name: Set variables
run: |
REGISTRY_IMAGE=fils/dagster-gleanerio-workflows
echo "REGISTRY_IMAGE=$REGISTRY_IMAGE" >> $GITHUB_ENV
working-directory: /
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=true
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
# - name: Set up Python 3.10
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# long version with lint,
# run: |
# python -m pip install --upgrade pip
# pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# pip install build
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Build package
# run: python -m build
# - name: Build tooling
# run: |
# cd ./tooling/cfgBuilder/${{ matrix.project }}
# python cfgBuilder.py -s https://foo.us/sitemap.xml
# - name: Generate
# working-directory: dagster/implnets
# run: |
# python pygen.py -cf ./configs/${{ matrix.project }}/gleanerconfig.yaml -od /temp/generatedDocker/implnet-${{ matrix.project }}/output -td ./templates/v1 -d 7
# - name: check
# working-directory: dagster/implnets
# run: |
# cat ./generatedCode/implnet-${{ matrix.project }}/output/ops/implnet_ops_amgeo.py
- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
#context: ./dagster/implnets
# grr https://github.com/docker/build-push-action#git-context
#context: "{{defaultContext}}"
push: true
build-args:
implnet=${{ matrix.project }}
#file: ./dagster/implnets/build/Dockerfile
file: ./build/Dockerfile_workflows
context: "{{defaultContext}}:dagster/implnets"
tags: ${{ steps.meta.outputs.tags }}
# tags: fils/ec_facets_client:latest
labels: ${{ steps.meta.outputs.labels }}
#platforms: ${{ matrix.platform }}
#outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Image digest
run: echo ${{ steps.build.outputs.digest }}