Skip to content

Commit 61f31e6

Browse files
committed
docker
1 parent 11f8f35 commit 61f31e6

5 files changed

Lines changed: 44 additions & 2 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,47 @@ on:
1212
permissions: read-all
1313

1414
jobs:
15+
push_to_registry:
16+
name: Push Docker Image to Docker Hub
17+
runs-on: ubuntu-latest
18+
environment: dev3
19+
outputs:
20+
image_digest: ${{ steps.build.outputs.digest }}
21+
steps:
22+
- name: Check out the repo
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
24+
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
31+
- name: Build and push Docker image
32+
id: build
33+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
34+
with:
35+
context: .
36+
file: ./Dockerfile
37+
push: true
38+
tags: jamesomesh/airflow:latest
39+
1540
deploy_to_dev3:
1641
name: Deploy to dev 3
1742
uses: ./.github/workflows/helm-deploy.yaml
43+
needs: push_to_registry
1844
with:
1945
environment: dev3
46+
image_digest: ${{ needs.push_to_registry.outputs.image_digest }}
2047
secrets: inherit
2148
# if: github.ref == 'refs/heads/main'
2249

2350
# deploy_to_prod1:
2451
# name: Deploy to prod 1
25-
# needs: deploy_to_dev3
52+
# needs: [ push_to_registry, deploy_to_dev3 ]
2653
# uses: ./.github/workflows/helm-deploy.yaml
2754
# with:
2855
# environment: prod1
56+
# image_digest: ${{ needs.push_to_registry.outputs.image_digest }}
2957
# secrets: inherit
3058
# if: github.ref == 'refs/heads/main'

.github/workflows/helm-deploy.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
environment:
88
required: true
99
type: string
10+
image_digest:
11+
required: true
12+
type: string
1013

1114
jobs:
1215
helm_deploy:
@@ -72,6 +75,8 @@ jobs:
7275
--set webserver.startupProbe.failureThreshold="60" \
7376
--set webserverSecretKey="${{ secrets.AIRFLOW_SECRET_KEY }}" \
7477
--set fernetKey="${{ secrets.AIRFLOW_FERNET_KEY }}" \
78+
--set images.airflow.repository="jamesomesh/airflow" \
79+
--set images.airflow.digest="${{ inputs.image_digest }}" \
7580
-f infra/extra.yaml
7681
7782
# Rolling restart

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM apache/airflow:2.8.4-python3.9
2+
3+
RUN pip install --no-cache-dir \
4+
requirements.txt

dags/nycmesh_generate_omni_cert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def deploy_to_omni(ip, password, cert_path, priv_key_path):
9292
print(stderr.read())
9393

9494
import subprocess
95-
subprocess.check_call([sys.executable, "-m", "pip", "install", "certbot", "certbot-dns-rfc2136", "paramiko==3.5.1", "scp==0.15.0", "cryptography==42.0.8"])
95+
#subprocess.check_call([sys.executable, "-m", "pip", "install", "certbot", "certbot-dns-rfc2136", "paramiko==3.5.1", "scp==0.15.0", "cryptography==42.0.8"])
9696

9797
# Imports inside of the virtual environment
9898
from paramiko import SSHClient, AutoAddPolicy

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
certbot
2+
certbot-dns-rfc2136
3+
paramiko==3.5.1
4+
scp==0.15.0
5+
cryptography==42.0.8

0 commit comments

Comments
 (0)