-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
419 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
|
||
name: Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main, develop] | ||
tags: ['*'] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
|
||
build-and-publish: | ||
|
||
name: Build and push the docker images | ||
|
||
strategy: | ||
matrix: | ||
build: [Dev, Prod] | ||
include: | ||
- build: Dev | ||
tag-suffix: '-dev' | ||
- build: Prod | ||
tag-suffix: '' | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
# Need to avoid a shallow clone (fetch-depth=1) so that the lookup of the tag works | ||
fetch-depth: 0 | ||
|
||
- name: Docker meta | ||
id: docker_meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository }} | ||
flavor: | | ||
latest=auto | ||
suffix=${{ matrix.tag-suffix }},onlatest=true | ||
tags: | | ||
type=semver,pattern={{raw}} | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
id: setup_buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
buildkitd-flags: --debug | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get previous tag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
id: tag_name | ||
with: | ||
fallback: beta | ||
|
||
- name: Build | ||
id: build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ${{ matrix.build }}/Dockerfile | ||
push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} | ||
build-args: | | ||
img_repo=python | ||
img_tag=bullseye | ||
common_tag=${{ steps.tag_name.outputs.tag }} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
platforms: linux/amd64 | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} | ||
|
||
|
||
# notify-packages: | ||
# | ||
# if: | | ||
# (github.event_name == 'push' && contains(github.ref, 'refs/tags/') ) | ||
# || github.event_name == 'release' | ||
# || github.event_name == 'workflow_dispatch' | ||
# name: Trigger new docker images of the P8 software packages | ||
# runs-on: ubuntu-latest | ||
# needs: [build-and-publish] | ||
# strategy: | ||
# matrix: | ||
# repo: ['project8/katydid'] | ||
## repo: ['project8/katydid', 'project8/locust_mc', 'project8/mermithid'] | ||
# steps: | ||
# | ||
# - name: Repository dispatch | ||
# uses: peter-evans/repository-dispatch@v1 | ||
# with: | ||
# token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
# repository: ${{ matrix.repo }} | ||
# event-type: release-event |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ARG img_repo=python | ||
ARG img_tag=bullseye | ||
|
||
ARG common_tag=beta | ||
|
||
FROM ${img_repo}:${img_tag} as base_image | ||
|
||
# Set bash as the default shell | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
ENV CMAKE_LIBRARY_PATH=/usr/lib64 | ||
ENV RapidJSON_DIR=/usr/lib64/cmake | ||
|
||
# P8 and COMMON paths | ||
ENV P8_ROOT=/usr/local/p8 | ||
ENV COMMON_TAG=${common_tag} | ||
ENV COMMON_BUILD_PREFIX=${P8_ROOT}/common/$COMMON_TAG | ||
|
||
# Copy all build scripts | ||
ARG scripts_dir=${P8_ROOT}/common/build_scripts | ||
COPY Scripts ${scripts_dir} | ||
|
||
# Install as many dependencies as possible using apt | ||
RUN ${scripts_dir}/install_packages.sh dev &&\ | ||
${scripts_dir}/install_python_packages.sh &&\ | ||
${scripts_dir}/install_other_packages.sh &&\ | ||
${scripts_dir}/create_common_setup.sh &&\ | ||
rm -rf ${scripts_dir} &&\ | ||
/bin/true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ARG img_repo=python | ||
ARG img_tag=bullseye | ||
|
||
ARG common_tag=beta | ||
|
||
FROM ${img_repo}:${img_tag} as base_image | ||
|
||
# Set bash as the default shell | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
ENV CMAKE_LIBRARY_PATH=/usr/lib64 | ||
ENV RapidJSON_DIR=/usr/lib64/cmake | ||
|
||
# P8 and COMMON paths | ||
ENV P8_ROOT=/usr/local/p8 | ||
ENV COMMON_TAG=${common_tag} | ||
ENV COMMON_BUILD_PREFIX=${P8_ROOT}/common/$COMMON_TAG | ||
|
||
# Copy all build scripts | ||
ARG scripts_dir=${P8_ROOT}/common/build_scripts | ||
COPY Scripts ${scripts_dir} | ||
|
||
# Install as many dependencies as possible using apt | ||
# Then do Python package installation | ||
# Then install other packages not available in apt | ||
# Create the setup.sh script | ||
# Finally, remove unnecessary programs | ||
# libhdf5-dev is removed because it was previously needed to install h5py, but isn't needed for running | ||
RUN ${scripts_dir}/install_packages.sh prod &&\ | ||
${scripts_dir}/install_python_packages.sh &&\ | ||
${scripts_dir}/install_other_packages.sh &&\ | ||
apt-get purge -y \ | ||
wget \ | ||
libhdf5-dev \ | ||
&&\ | ||
${scripts_dir}/create_common_setup.sh &&\ | ||
rm -rf ${scripts_dir} &&\ | ||
/bin/true |
Oops, something went wrong.