Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate builds of our own customized Airflow container and the content syncer one. #33

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Airflow containers
name: Airflow content syncer container
on:
push:
branches:
- "main"
paths:
- airflow-content-syncer/**
- airflow-customized/**
- .github/**
pull_request:
paths:
- airflow-content-syncer/**
- airflow-customized/**
- .github/**

concurrency:
Expand Down Expand Up @@ -49,37 +47,6 @@ jobs:
cache: false
cache-repository: ghcr.io/${{ github.repository }}/cache
context: airflow-content-syncer
build-airflow-customized:
name: Build customized Airflow container
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
# This image is based on ubuntu:20.04
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}/airflow-customized
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,format=long
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: int128/kaniko-action@v1
name: Create airflow-customized container
with:
push: false
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache: false
cache-repository: ghcr.io/${{ github.repository }}/cache
context: airflow-customized
publish-airflow-content-syncer:
name: Publish Airflow content syncer container
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down Expand Up @@ -111,35 +78,3 @@ jobs:
cache: false
cache-repository: ghcr.io/${{ github.repository }}/cache
context: airflow-content-syncer
publish-airflow-customized:
name: Publish customized Airflow container
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
# This image is based on ubuntu:20.04
steps:
- uses: actions/checkout@v4

- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}/airflow-customized
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,format=long
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: int128/kaniko-action@v1
name: Create and publish airflow-customized container
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache: false
cache-repository: ghcr.io/${{ github.repository }}/cache
context: airflow-customized
81 changes: 81 additions & 0 deletions .github/workflows/airflow-customized-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Airflow customized container
on:
push:
branches:
- "main"
paths:
- airflow-customized/**
- .github/**
pull_request:
paths:
- airflow-customized/**
- .github/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-airflow-customized:
name: Build customized Airflow container
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
# This image is based on ubuntu:20.04
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}/airflow-customized
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,format=long
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: int128/kaniko-action@v1
name: Create airflow-customized container
with:
push: false
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache: false
cache-repository: ghcr.io/${{ github.repository }}/cache
context: airflow-customized
publish-airflow-customized:
name: Publish customized Airflow container
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
# This image is based on ubuntu:20.04
steps:
- uses: actions/checkout@v4

- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}/airflow-customized
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,format=long
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: int128/kaniko-action@v1
name: Create and publish airflow-customized container
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache: false
cache-repository: ghcr.io/${{ github.repository }}/cache
context: airflow-customized
2 changes: 2 additions & 0 deletions airflow-customized/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ USER root
RUN \
apt-get update && \
apt-get install -y git && \
apt-get purge -y msodbcsql18 odbcinst && \
apt-get upgrade -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/log/*

Expand Down
Loading