Skip to content

AP-554: build a UCBLIT-specific Airflow image#1

Merged
anarchivist merged 11 commits intomainfrom
AP-554-build-image
Feb 6, 2026
Merged

AP-554: build a UCBLIT-specific Airflow image#1
anarchivist merged 11 commits intomainfrom
AP-554-build-image

Conversation

@anarchivist
Copy link
Member

  • I believe all Airflow config options can be passed in as env variables per the configuration documentation.
  • This includes a single test called from the build pipeline to ensure there are no import errors in the Airflow dags.

* I believe all Airflow config options can be passed in as env variables per the
[configuration documentation](https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html).
* This includes a single test called from the build pipeline to ensure there are
no import errors in the Airflow dags.
@anarchivist anarchivist marked this pull request as draft February 3, 2026 01:57
Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good. A few things to address.

Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. r+ after Docker Compose is running properly in CI.

@anarchivist anarchivist force-pushed the AP-554-build-image branch 6 times, most recently from 5ea163a to 2a88a9c Compare February 3, 2026 22:13
@anarchivist anarchivist requested a review from awilfox February 3, 2026 22:14
@anarchivist anarchivist marked this pull request as ready for review February 3, 2026 22:14
@anarchivist
Copy link
Member Author

I have the build passing. One thing to note - in GHA, the container is running as root, which I don't love, but that seems to be the first thing that fixed the Error: EACCES: permission denied when it runs actions/checkout@v4 in the test job. Feedback/suggestions here are welcome.

Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. A few questions to think over, then r+.

@anarchivist anarchivist force-pushed the AP-554-build-image branch 11 times, most recently from de7661a to 1d776e9 Compare February 4, 2026 04:35
@anarchivist anarchivist force-pushed the AP-554-build-image branch 2 times, most recently from 5c17118 to 35bbee5 Compare February 4, 2026 04:50
@anarchivist
Copy link
Member Author

anarchivist commented Feb 4, 2026

Okay - v2 separates the docker startup checks from the dag import checks, which don't require a full Airflow deployment to run. Accordingly, it uploads two test result artifacts - one for Docker/Compose-related logs and one for the Python unittest output.

awilfox
awilfox previously requested changes Feb 4, 2026
Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a fix needed for the test runner (edit: there is no fix needed for the test runner, I miscounted the number of parent calls), and a question on the build workflow regarding the version of Airflow. Otherwise, lgtm.

@anarchivist anarchivist force-pushed the AP-554-build-image branch 2 times, most recently from 02ff98c to 139cbe5 Compare February 4, 2026 19:32
we can successfully get unittest output written in the container
and copy it out now
@anarchivist anarchivist force-pushed the AP-554-build-image branch 2 times, most recently from cacd207 to 7177b75 Compare February 4, 2026 20:08
@anarchivist anarchivist requested a review from awilfox February 4, 2026 20:12
@anarchivist anarchivist dismissed awilfox’s stale review February 4, 2026 20:15

all outstanding issues have been fixed

Copy link
Member

@danschmidt5189 danschmidt5189 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing major jumped out, but I am very curious about the intention behind running the test stage in a container while also using docker-compose commands. I have to be missing something there!


USER airflow
WORKDIR /home/airflow
COPY --chown=airflow:0 requirements.txt .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use the GID "0" rather than "root", as we do everywhere else? We only use IDs when necessary, e.g. at runtime when the given named user doesn't exist in the container.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is relates to an Airflow-on-OpenShiftism that I'm trying to keep consistent with upstream. I'm happy to change it if we don't care:

Airflow image is Open-Shift compatible, which means that you can start it with random user ID and the
group id 0 (root). If you want to run the image with user different than Airflow, you MUST set
GID of the user to 0. In case you try to use different group, the entrypoint exits with error.

OpenShift randomly assigns UID when it starts the container, but you can utilise this flexible UID
also in case of running the image manually. This might be useful for example in case you want to
mount dag and logs folders from host system on Linux, in which case the UID should be set
the same ID as your host user.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relatedly, the overly-complex command for airflow-init is pulled mostly from the upstream compose file.

also, clean up the airflow-init container; minor docs fix
@anarchivist anarchivist merged commit e346a13 into main Feb 6, 2026
5 checks passed
@anarchivist anarchivist deleted the AP-554-build-image branch February 6, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants