Skip to content

Commit

Permalink
#2 Add Github Action build workflow (#40)
Browse files Browse the repository at this point in the history
Initial build workflow
  • Loading branch information
aaron-gary authored May 3, 2024
1 parent 1464f6c commit 23dde27
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 218 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/build.yml
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: 'dev'
push:
branches: [ "dev" ]

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') }}
46 changes: 1 addition & 45 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<version.cryptography>&gt;=42.0.4</version.cryptography>
<version.python.krausening>&gt;=${version.krausening}</version.python.krausening>
<version.slf4j>2.0.7</version.slf4j>
<version.delta.hive.connector>0.6.0</version.delta.hive.connector>

<!-- Spark Default Dependencies. See `spark-*` profiles below for alternative sets -->
<version.spark>3.4.0</version.spark>
Expand Down Expand Up @@ -963,51 +964,6 @@ To suppress enforce-helm-version rule, you must add following plugin to the root
</build>
</profile>

<!-- The profile aiops-release must be active when a project is released.
The configuration in this POM will automatically call this profile if using
the maven-release-plugin. If the maven-release-plugin is not used during
the release, this profile must be manually activated. -->
<profile>
<id>aiops-release</id>
<build>
<plugins>
<!-- Create a source-release artifact that contains the fully buildable
project directory source structure. This should be released to the Maven
repository for each AIOps project release. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>doclint-java8-disable</id>
<activation>
Expand Down
29 changes: 0 additions & 29 deletions extensions/extensions-docker/aissemble-airflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,4 @@

<packaging>orphedomos</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>extensions-docker-cacerts</artifactId>
<version>${project.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/cacerts</outputDirectory>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get update && apt-get install -y \
ant \
fontconfig \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,4 @@
<description>A base image for a Jenkins Controller</description>

<packaging>orphedomos</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>extensions-docker-cacerts</artifactId>
<version>${project.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/cacerts</outputDirectory>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ FROM jenkins/jenkins:lts-jdk11
LABEL org.opencontainers.image.source = "https://github.com/boozallen/aissemble"

USER root
COPY ./target/cacerts/* /usr/local/share/ca-certificates/
# Update CA certificates and import each certificate in the directory
RUN update-ca-certificates && \
for cert in /usr/local/share/ca-certificates/*.crt; do \
keytool -import -trustcacerts -keystore "$JAVA_HOME/lib/security/cacerts" -storepass changeit -noprompt -file "$cert"; \
done
USER jenkins

RUN jenkins-plugin-cli --plugins git:4.11.2
Expand Down
30 changes: 0 additions & 30 deletions extensions/extensions-docker/aissemble-nvidia/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,4 @@
<description>A base image for a Nvidia Cuda implementation</description>

<packaging>orphedomos</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>extensions-docker-cacerts</artifactId>
<version>${project.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/cacerts</outputDirectory>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ RUN printf '#!/bin/bash\n\nif [[ "$1" == "-r" ]] ;then\n echo '4.9.250'\n exit\n
RUN chmod 755 /bin/uname
# Workaround for ubuntu fix end

COPY ./target/cacerts/* /usr/local/share/ca-certificates/

RUN update-ca-certificates && apt-get update \
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y openjdk-11-jdk \
&& update-ca-certificates \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
<artifactId>delta-storage</artifactId>
<version>${version.delta}</version>
</dependency>
<dependency>
<groupId>io.delta</groupId>
<artifactId>delta-hive-assembly_2.12</artifactId>
<version>${version.delta.hive.connector}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ARG VERSION_AISSEMBLE
ARG DOCKER_BASELINE_REPO_ID
FROM ${DOCKER_BASELINE_REPO_ID}boozallen/aissemble-spark:${VERSION_AISSEMBLE}
ARG DELTA_HIVE_CONNECTOR_VERSION

LABEL org.opencontainers.image.source = "https://github.com/boozallen/aissemble"

RUN curl -L https://github.com/delta-io/connectors/releases/download/v${DELTA_HIVE_CONNECTOR_VERSION}/delta-hive-assembly_2.12-${DELTA_HIVE_CONNECTOR_VERSION}.jar \
-o "${SPARK_HOME}"/jars/delta-hive-assembly_2.12-${DELTA_HIVE_CONNECTOR_VERSION}.jar
ARG JARS_DIR

ADD ${JARS_DIR}/* ${SPARK_HOME}/jars/

ENV SPARK_NO_DAEMONIZE=true
Expand Down
25 changes: 0 additions & 25 deletions extensions/extensions-docker/aissemble-spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>extensions-docker-cacerts</artifactId>
<version>${project.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/cacerts</outputDirectory>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 23dde27

Please sign in to comment.