-
Notifications
You must be signed in to change notification settings - Fork 8
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
#2 Add Github Action build workflow #40
Changes from 2 commits
bc94735
2b85eff
1c5eff1
abe7551
fa4c79e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Build aissemble | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
buildBranch: | ||
description: "Branch you want to build" | ||
required: true | ||
type: string | ||
default: '2-build-action' | ||
push: | ||
branches: [ "2-build-action" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.buildBranch }} | ||
- name: Install Python # use direct install rather than pyenv for CI for large speed improvement | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11.4' | ||
- name: Load cached Poetry installation | ||
id: cached-poetry | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: poetry-0 # increment to reset cache | ||
- name: Load m2 repository cache # Manually caching .m2 repo as the setup-java caching isn't falling back to older caches | ||
id: cached-m2-repo | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
maven- | ||
- name: Load m2 build cache | ||
id: cached-m2-build | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/build-cache | ||
key: maven-build-cache-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
maven-build-cache- | ||
- name: Install Poetry | ||
if: steps.cached-poetry.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
- name: Install Docker | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | ||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install docker-ce docker-ce-cli containerd.io | ||
- name: Install Helm | ||
run: | | ||
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | ||
chmod 700 get_helm.sh | ||
./get_helm.sh | ||
- name: Build aiSSEMBLE | ||
run: ./mvnw -B clean install --file pom.xml -Dhabushu.usePyenv=false -Pci | ||
#NB: The following two explicit cache saves are necessary to ensure caches are saved on build failure, until | ||
# https://github.com/actions/cache/issues/1315 is resolved | ||
- name: Save m2 repository cache | ||
id: save-m2-repo | ||
uses: actions/cache/save@v4 | ||
if: always() | ||
with: | ||
path: ~/.m2/repository | ||
key: maven-${{ hashFiles('**/pom.xml') }} | ||
- name: Save m2 build cache | ||
id: save-m2-build | ||
uses: actions/cache/save@v4 | ||
if: always() | ||
with: | ||
path: ~/.m2/build-cache | ||
key: maven-build-cache-${{ hashFiles('**/pom.xml') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,7 @@ LABEL org.opencontainers.image.source = "https://github.com/boozallen/aissemble" | |
|
||
USER root | ||
|
||
COPY ./target/cacerts/* /usr/local/share/ca-certificates/ | ||
|
||
RUN update-ca-certificates && apt-get update && apt-get install -y --no-install-recommends apt-utils | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this gonna make the images unbuildable from a BAH device since they needs the certs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you log out of your VPN to do the build you should be able to build just fine. But we can't really install certs specific to one organization. I think long-term it'd be nice to find some sort of just-in-time solution that allows VPN CA certs to be made available without actually modifying the final image. |
||
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils | ||
RUN apt-get update && apt-get install -y \ | ||
ant \ | ||
fontconfig \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,9 @@ FROM ${DOCKER_BASELINE_REPO_ID}boozallen/aissemble-spark:${VERSION_AISSEMBLE} | |
|
||
LABEL org.opencontainers.image.source = "https://github.com/boozallen/aissemble" | ||
|
||
RUN curl -L https://github.com/delta-io/connectors/releases/download/v0.6.0/delta-hive-assembly_2.12-0.6.0.jar \ | ||
-o "${SPARK_HOME}"/jars/delta-hive-assembly_2.12-0.6.0.jar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A: Should probably pass the connector version as a docker build arg from the POM so we can drive version numbers from Maven. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree
|
||
ARG JARS_DIR | ||
|
||
ADD ${JARS_DIR}/* ${SPARK_HOME}/jars/ | ||
|
||
ENV SPARK_NO_DAEMONIZE=true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: Should update these to
dev
. It might also make sense to have this run when a PR to dev is open and use the PR branch as the input build branch. But that can come in later iterations once we get the dev branch building locally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch