Skip to content
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

Fixed dockerize install steps - 5.x #296

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7c79d34
Updated tag references to 6.x
nicksantamaria Jan 16, 2024
2c897a6
Upgrade to node v20 (#218)
nicksantamaria Jan 16, 2024
a8c598a
Update php base images to 8.3 (#219)
nicksantamaria Jan 16, 2024
34a355d
Updated schedule for vulnerability scan.
nicksantamaria Jan 17, 2024
937496b
Update bay cli to v0.1.0 (#240)
nicksantamaria Jan 29, 2024
cc3ea16
[DDS-1844] Add AWX EE builds. (#245)
GROwen Feb 21, 2024
d94ba3c
[DDS-1871] Updated default user home path. (#246)
GROwen Feb 22, 2024
051c355
fix: pinned versions for gql requirements
yusufhm Feb 28, 2024
8f3032c
Merge pull request #248 from yusufhm/fix/awx-ee-gql-requirements
GROwen Feb 28, 2024
b479a73
Merge pull request #249 from dpc-sdp/build/DDS-1872--inventory-sync-e…
GROwen Feb 29, 2024
3290008
[DDS-1874] Added php-curl pkg. (#247)
GROwen Feb 29, 2024
9471ece
Added apache2-utils to leverage htpasswd command
nicksantamaria Mar 13, 2024
04af5c3
Added apache2-utils to leverage htpasswd command
nicksantamaria Mar 13, 2024
1ea893c
Port changes from 5.x (#255)
GROwen Mar 27, 2024
f8a5387
Bump lagoon-cli to 0.21.3 (6.x) (#261)
nicksantamaria May 9, 2024
96217bd
Bumped yamlfmt to 0.12.1 (#259)
nicksantamaria May 9, 2024
36d1f45
[DDS-1944] Added key decrytion support to node images. (#263)
GROwen May 13, 2024
33cbe89
[SDPSUP-7185] Update search endpoints to use http (#264)
GROwen May 22, 2024
19b6e0f
Switch from mailhog to mailpit. (#268)
nicksantamaria Jul 15, 2024
1a713f9
[269] Exclude mailpit 5.x from scans. (#270)
GROwen Jul 25, 2024
f4f941f
[DDS-1993] Added ssh-client for lagoon token fetch. (#272)
GROwen Aug 9, 2024
fcb56f1
[DDS-1993] Updated keys dir default file perms. (#273)
GROwen Aug 13, 2024
fe08a5b
Bumped bay-cli to v1.1.2 (#277)
nicksantamaria Aug 15, 2024
df352b8
[6.x] Fixed bay-cli version. (#281)
GROwen Aug 16, 2024
38d35e1
[DDS-2006] Updated base branch for scan for 6.x (#280)
GROwen Aug 20, 2024
472648c
Added section-io-id to nginx log output (#283)
nicksantamaria Aug 20, 2024
3bce41c
Fixed image reference for scan. (#284)
GROwen Aug 22, 2024
fff2fa5
Added ability to comment on a PR to trigger a build
nicksantamaria Aug 22, 2024
739a577
Patches 2024-08-22 (6.x) (#285)
nicksantamaria Aug 28, 2024
e22abb2
Bumped bay-cli to v1.1.3 (#289)
nicksantamaria Aug 29, 2024
c884d9c
Added GH annotations. (#290)
GROwen Aug 29, 2024
3003101
Reverted dockerize version. (#293)
GROwen Sep 3, 2024
2ffd408
[revert-dockerize-version-cmd-fix] Fixed dockerize install steps.
GROwen Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ Improvement - Description (#ISSUENUMBER)

# Closing issues
Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

# PR Comment Commands

- Commenting `/build` on a pull request will trigger the build & deploy workflow for the current branch.
31 changes: 28 additions & 3 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- closed
- opened
- synchronize
issue_comment:
types:
- created
schedule:
- cron: '23 20 * * 0'
workflow_dispatch:
Expand All @@ -14,7 +17,11 @@ env:
REGISTRY: ghcr.io
jobs:
buildx:
if: github.event.pull_request.merged == true || contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) || github.event_name == 'pull_request' && startsWith(github.head_ref,'build/')
if: |-
github.event.pull_request.merged == true ||
contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) ||
github.event_name == 'pull_request' && startsWith(github.head_ref,'build/') ||
( github.event.issue.pull_request && contains(github.event.comment.body, '/build') )
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -24,7 +31,7 @@ jobs:
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v3

Expand All @@ -45,6 +52,7 @@ jobs:
type=ref,event=pr,enable=${{ github.event.pull_request.merged == false }}
type=raw,value=${{ github.event.pull_request.base.ref }},enable=${{ github.event.pull_request.merged == true }}
type=ref,event=branch,enable=${{ contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) }}
type=raw,event=default,value=pr-${{ github.event.issue.number }},enable=${{ github.event.issue.pull_request != null }}
labels: |
maintainer=Digital Victoria
repository=${{ github.repositoryUrl }}
Expand All @@ -53,6 +61,23 @@ jobs:
org.opencontainers.image.title=${{ matrix.images }}
org.opencontainers.image.description=${{ matrix.images }} image for Bay container platform

- name: Create the AWX-EE context
if: matrix.images == 'awx-ee'
run: |
pip install --upgrade ansible-builder
ansible-builder create \
--output-filename Dockerfile \
--verbosity 3
working-directory: ./images/awx-ee

- name: Upload AWX-EE context for review
if: matrix.images == 'awx-ee'
uses: actions/upload-artifact@v4
with:
name: awx-ee-context
path: ./images/awx-ee/context
retention-days: 1

- name: Build and push the images
uses: docker/[email protected]
with:
Expand All @@ -61,4 +86,4 @@ jobs:
./gh-actions-bake.hcl
${{ steps.meta.outputs.bake-file }}
# Target the default group - probably unnecessary.
targets: ${{ matrix.images }}
targets: ${{ matrix.images }}
2 changes: 1 addition & 1 deletion .github/workflows/vulnerability-scan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
echo "SANITISED-REF-NAME=${{ github.ref_name }}" | tr '/' '-' >> "$GITHUB_OUTPUT"
- name: Scan for vulnerabilities
id: scan
uses: crazy-max/ghaction-container-scan@v2
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}:${{ steps.sanitise-ref-name.outputs.SANITISED-REF-NAME }}
dockerfile: ./images/${{ matrix.images }}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/vulnerability-scan-schedule-5x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: vulnerability-scan-schedule
run-name: Scheduled CVE vulnerability scan of published images.
env:
REGISTRY: ghcr.io
on:
schedule:
- cron: '0 22 * * 3'
workflow_dispatch:
jobs:
vulnerability-scan-schedule:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
strategy:
matrix:
images: ${{ fromJson(vars.IMAGES) }}
exclude:
- images: mailpit
steps:
- uses: actions/checkout@v4
with:
ref: 5.x
- name: Scan for vulnerabilities
id: scan
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}:5.x
annotations: true
dockerfile: ./images/${{ matrix.images }}
- name: Upload SARIF file
if: ${{ steps.scan.outputs.sarif != '' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
32 changes: 32 additions & 0 deletions .github/workflows/vulnerability-scan-schedule-6x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: vulnerability-scan-schedule
run-name: Scheduled CVE vulnerability scan of published images.
env:
REGISTRY: ghcr.io
on:
schedule:
- cron: '0 22 * * 3'
workflow_dispatch:

jobs:
vulnerability-scan-schedule:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
strategy:
matrix:
images: ${{ fromJson(vars.IMAGES) }}
steps:
- uses: actions/checkout@v4
with:
ref: 6.x
- name: Scan for vulnerabilities
id: scan
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}:6.x
annotations: true
dockerfile: ./images/${{ matrix.images }}
- name: Upload SARIF file
if: ${{ steps.scan.outputs.sarif != '' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
46 changes: 0 additions & 46 deletions .github/workflows/vulnerability-scan-schedule.yml

This file was deleted.

23 changes: 19 additions & 4 deletions gh-actions-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ target "elasticsearch" {
}
target "mailhog" {
inherits = ["docker-metadata-action"]
context = "${CONTEXT}/mailhog"
context = "${CONTEXT}/mailpit"
dockerfile = "Dockerfile"

platforms = ["linux/amd64", "linux/arm64"]
}
target "mailpit" {
inherits = ["docker-metadata-action"]
context = "${CONTEXT}/mailpit"
dockerfile = "Dockerfile"

platforms = ["linux/amd64", "linux/arm64"]
Expand Down Expand Up @@ -60,7 +67,7 @@ target "php-cli" {

labels = {
"org.opencontainers.image.description" = "PHP Drupal CLI image for Bay container platform"
"org.opencontainers.image.source" = "https://github.com/dpc-sdp/bay/blob/5.x/images/bay-php/Dockerfile.cli"
"org.opencontainers.image.source" = "https://github.com/dpc-sdp/bay/blob/6.x/images/bay-php/Dockerfile.cli"
}
}
target "php-fpm" {
Expand All @@ -72,7 +79,7 @@ target "php-fpm" {

labels = {
"org.opencontainers.image.description" = "PHP-FPM image for Bay container platform"
"org.opencontainers.image.source" = "https://github.com/dpc-sdp/bay/blob/5.x/images/bay-php/Dockerfile.fpm"
"org.opencontainers.image.source" = "https://github.com/dpc-sdp/bay/blob/6.x/images/bay-php/Dockerfile.fpm"
}
}
target "ripple-static" {
Expand All @@ -86,4 +93,12 @@ target "ripple-static" {
"org.opencontainers.image.description" = "Ripple static site generator image optimised for the Bay container platform"
}
}

target "awx-ee" {
inherits = ["docker-metadata-action"]
context = "${CONTEXT}/awx-ee/context"
platforms = ["linux/amd64", "linux/arm64"]
args = {
PYCMD = "/usr/local/bin/python3"
PKGMGR = "/usr/bin/apt-get"
}
}
10 changes: 5 additions & 5 deletions images/awx-ee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The AWX execution environment is a container image that AWX will use to execute
- `requirements.txt`: Defined python dependencies
- `requirements.yml`: Ansible collections to install

AWX has `singledigital/awx-ee:latest` added as an execution environment with a pull policy of always, when the image is updated kuberenetes will pull a new image to run the plays in.
AWX has `ghcr.io/dpc-sdp/bay/awx-ee:6.x` added as an execution environment with a pull policy of always, when the image is updated kuberenetes will pull a new image to run the plays in.

## Dependencies

Expand All @@ -20,7 +20,7 @@ AWX has `singledigital/awx-ee:latest` added as an execution environment with a p
Commands run from this directory if you have ansible-builder installed locally.

```
$ ansible-builder build --tag singledigital/awx-ee:latest --container-runtime docker
$ ansible-builder build --tag ghcr.io/dpc-sdp/bay/awx-ee:6.x --container-runtime docker
```

OR run with docker.
Expand All @@ -31,14 +31,14 @@ $ docker run --rm -it \
-v $(pwd):/data \
-w /data \
quay.io/ansible/ansible-builder:latest \
ansible-builder build --tag singledigital/awx-ee:latest --container-runtime docker
ansible-builder build --tag ghcr.io/dpc-sdp/bay/awx-ee:6.x --container-runtime docker

# Build the image
$ docker build -f context/Dockerfile -t singledigital/awx-ee:latest context
$ docker build -f context/Dockerfile -t ghcr.io/dpc-sdp/bay/awx-ee:6.x context
```

## Deploying the image

```
$ docker push singledigital/awx-ee:latest
$ docker push ghcr.io/dpc-sdp/bay/awx-ee:6.x
```
1 change: 1 addition & 0 deletions images/awx-ee/bindep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ curl
openssl
jq
rsync
apache2-utils
12 changes: 5 additions & 7 deletions images/awx-ee/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ variable "IMAGE_TAG" {
}

group "default" {
targets = ["ee"]
targets = ["awx-ee"]
}

target "ee" {
target "docker-metadata-action" {}

target "awx-ee" {
inherits = ["docker-metadata-action"]
context = "./context"
dockerfile = "Dockerfile"
platforms = ["linux/amd64", "linux/arm64"]
tags = [
// "singledigital/awx-ee:${IMAGE_TAG}",
"${GHCR}/dpc-sdp/bay/awx-ee:${IMAGE_TAG}"
]
args = {
PYCMD = "/usr/local/bin/python3"
PKGMGR = "/usr/bin/apt-get"
Expand Down
Loading
Loading