From 134416ae9e3fb8ff6eb669ad96c4a79d7bbd2d2d Mon Sep 17 00:00:00 2001 From: Naman Gulati Date: Wed, 13 Oct 2021 13:44:31 -0400 Subject: [PATCH] Added workflows to build and push images for CLP core's dependencies and CLP's execution environment (#14) --- .../workflows/clp-dependency-image-build.yaml | 43 +++++++++++++++++++ .../workflows/clp-execution-image-build.yaml | 43 +++++++++++++++++++ README.md | 8 ++++ .../clp-execution-base-focal/Dockerfile | 10 +++++ .../install-packages-from-source.sh | 3 ++ .../install-prebuilt-packages.sh | 7 +++ 6 files changed, 114 insertions(+) create mode 100644 .github/workflows/clp-dependency-image-build.yaml create mode 100644 .github/workflows/clp-execution-image-build.yaml create mode 100644 tools/docker-images/clp-execution-base-focal/Dockerfile create mode 100755 tools/docker-images/clp-execution-base-focal/setup-scripts/install-packages-from-source.sh create mode 100755 tools/docker-images/clp-execution-base-focal/setup-scripts/install-prebuilt-packages.sh diff --git a/.github/workflows/clp-dependency-image-build.yaml b/.github/workflows/clp-dependency-image-build.yaml new file mode 100644 index 000000000..80333e376 --- /dev/null +++ b/.github/workflows/clp-dependency-image-build.yaml @@ -0,0 +1,43 @@ +name: Build and Publish Image with Dependencies to Build CLP Core + +on: + push: + branches: ['main'] + paths: + - 'components/core/tools/docker-images/clp-env-base-focal/**' + - 'components/core/tools/scripts/lib_install/**' + - '.github/workflows/clp-dependency-image-build.yaml' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{github.repository}}/clp-core-dependencies-x86-ubuntu-focal + +jobs: + build: + runs-on: ubuntu-20.04 + name: Build Image + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v2 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: components/core/ + file: components/core/tools/docker-images/clp-env-base-focal/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/clp-execution-image-build.yaml b/.github/workflows/clp-execution-image-build.yaml new file mode 100644 index 000000000..0c7368e9a --- /dev/null +++ b/.github/workflows/clp-execution-image-build.yaml @@ -0,0 +1,43 @@ +name: Build and Publish Image with Execution Dependencies + +on: + push: + branches: ['main'] + paths: + - 'components/core/tools/docker-images/clp-execution-base-focal/**' + - 'components/core/tools/scripts/lib_install/**' + - '.github/workflows/clp-execution-image-build.yaml' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{github.repository}}/clp-execution-x86-ubuntu-focal + +jobs: + build: + runs-on: ubuntu-20.04 + name: Build Image + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v2 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./tools/docker-images/clp-execution-base-focal/Dockerfile + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index 07808740a..91b899c4f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,14 @@ directory: * [package-template](components/package-template) contains the base directory structure and files of the CLP package. +## Packages +The packages held by this [repository](https://github.com/orgs/y-scope/packages?repo_name=clp) are: + +1. Docker Image `clp/clp-core-dependencies-x86-ubuntu-focal` + - A docker image containing all the necessary dependencies to build CLP core in an x86 environment +2. Docker Image `clp/clp-execution-x86-ubuntu-focal` + - A docker image containing all the necessary dependencies to run the full CLP package in an x86 environment + ## Next Steps This is our open-source release which we will be constantly updating with bug fixes, features, etc. diff --git a/tools/docker-images/clp-execution-base-focal/Dockerfile b/tools/docker-images/clp-execution-base-focal/Dockerfile new file mode 100644 index 000000000..a17207a6f --- /dev/null +++ b/tools/docker-images/clp-execution-base-focal/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:focal + +RUN mkdir -p /root/tools/docker-images/clp-execution-base-focal +ADD ./tools/docker-images/clp-execution-base-focal/setup-scripts /root/tools/docker-images/clp-execution-base-focal/setup-scripts + +RUN mkdir -p /root/tools/scripts/lib_install +ADD ./components/core/tools/scripts/lib_install /root/tools/scripts/lib_install + +RUN cd /root && ./tools/docker-images/clp-execution-base-focal/setup-scripts/install-prebuilt-packages.sh +RUN cd /root && ./tools/docker-images/clp-execution-base-focal/setup-scripts/install-packages-from-source.sh diff --git a/tools/docker-images/clp-execution-base-focal/setup-scripts/install-packages-from-source.sh b/tools/docker-images/clp-execution-base-focal/setup-scripts/install-packages-from-source.sh new file mode 100755 index 000000000..473ecaeee --- /dev/null +++ b/tools/docker-images/clp-execution-base-focal/setup-scripts/install-packages-from-source.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./tools/scripts/lib_install/mariadb-connector-c.sh 3.2.3 diff --git a/tools/docker-images/clp-execution-base-focal/setup-scripts/install-prebuilt-packages.sh b/tools/docker-images/clp-execution-base-focal/setup-scripts/install-prebuilt-packages.sh new file mode 100755 index 000000000..8901f86e5 --- /dev/null +++ b/tools/docker-images/clp-execution-base-focal/setup-scripts/install-prebuilt-packages.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y checkinstall \ + rabbitmq-server \ + rsync \ + wget