diff --git a/.github/actions/build_image/action.yml b/.github/actions/build_image/action.yml index b243b58a..366bf53e 100644 --- a/.github/actions/build_image/action.yml +++ b/.github/actions/build_image/action.yml @@ -1,6 +1,6 @@ --- name: Build App Images -description: Build one of the App images (pulp, pulp-minimal, galaxy, galaxy-minimal) +description: Build one of the App images (pulp, pulp-minimal) inputs: image_variant: description: 'Whether the image is a stable or nightly build' @@ -48,7 +48,7 @@ runs: sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes for ARCH in arm64 amd64 do - if [[ "${{ inputs.image_name }}" == "pulp-minimal" || "${{ inputs.image_name }}" == "galaxy-minimal" ]]; then + if [[ "${{ inputs.image_name }}" == "pulp-minimal" ]]; then base_image=$(echo ${{ inputs.image_name }} | cut -d '-' -f1) podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ inputs.image_name }}/${{ inputs.image_variant }}/Containerfile.core --tag pulp/${{ inputs.image_name }}:ci-${ARCH} --build-arg FROM_TAG=ci-${ARCH} . podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ inputs.image_name }}/${{ inputs.image_variant }}/Containerfile.webserver --tag pulp/${base_image}-web:ci-${ARCH} --build-arg FROM_TAG=ci-${ARCH} . @@ -63,12 +63,7 @@ runs: id: image_version_branch run: | base_image=$(echo ${{ inputs.image_name }} | cut -d '-' -f1) - if [[ "${base_image}" == "pulp" ]]; then - pip_name="pulpcore" - else - pip_name="galaxy-ng" - fi - app_version=$(podman run --pull=never pulp/${{ inputs.image_name }}:ci-amd64 bash -c "pip3 show ${pip_name} | sed -n -e 's/Version: //p'") + app_version=$(podman run --pull=never pulp/${{ inputs.image_name }}:ci-amd64 bash -c "pip3 show pulpcore | sed -n -e 's/Version: //p'") app_branch=$(echo ${app_version} | grep -oP '\d+\.\d+') echo "APP_VERSION: ${app_version}" diff --git a/.github/actions/test_image/action.yml b/.github/actions/test_image/action.yml index 4842c5ab..5e251c59 100644 --- a/.github/actions/test_image/action.yml +++ b/.github/actions/test_image/action.yml @@ -5,10 +5,6 @@ inputs: image_name: description: 'Name of the image to be tested' required: true - image_variant: - description: 'Stable or nightly build' - required: true - default: 'stable' app_branch: description: 'The branch the app was built on' required: true @@ -31,16 +27,8 @@ runs: podman rm pulp shell: bash - - name: Test the image in s6 mode (galaxy) - if: inputs.image_name == 'galaxy' - run: | - images/s6_assets/test.sh "pulp/${{ inputs.image_name }}:ci-amd64" https - podman stop pulp - podman rm pulp - shell: bash - - name: Test Compose up - if: inputs.image_name == 'pulp-minimal' || inputs.image_name == 'galaxy-minimal' + if: inputs.image_name == 'pulp-minimal' run: | base_image=$(echo ${{ inputs.image_name }} | cut -d '-' -f1) images/compose/test.sh "${{ inputs.image_name }}:ci-amd64" "${base_image}-web:ci-amd64" "compose.yml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe2601b2..2fcab260 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,20 +50,8 @@ jobs: base-images: runs-on: ubuntu-latest outputs: - image_variants: "${{ steps.image_variants.outputs.image_variants }}" base_cache_key: "${{ steps.build_base_images.outputs.base_cache_key }}" steps: - # We do not want to build nightly images unless it's a PR to the latest branch, - # or a branch/dispatch build on the latest branch. - - name: Set the list of image_variants for later jobs - id: image_variants - run: | - if [ "${{ github.base_ref }}" == "latest" ] || [ "${{ github.ref_name }}" == "latest" ]; then - echo "image_variants=[\"nightly\",\"stable\"]" >> "$GITHUB_OUTPUT" - else - echo "image_variants=[\"stable\"]" >> "$GITHUB_OUTPUT" - fi - - uses: actions/checkout@v4 - name: Build base images @@ -81,12 +69,9 @@ jobs: strategy: fail-fast: false matrix: - image_variant: ${{ fromJSON(needs.base-images.outputs.image_variants) }} image_name: - pulp-minimal - pulp - - galaxy-minimal - - galaxy steps: - uses: actions/checkout@v4 @@ -95,14 +80,13 @@ jobs: uses: "./.github/actions/build_image" with: image_name: ${{ matrix.image_name }} - image_variant: ${{ matrix.image_variant }} + image_variant: "stable" image_cache_key: ${{ needs.base-images.outputs.base_cache_key }} - name: Test App Image uses: "./.github/actions/test_image" with: image_name: ${{ matrix.image_name }} - image_variant: ${{ matrix.image_variant }} app_branch: ${{ steps.build_image.outputs.app_branch }} - name: Logs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9009f95e..01197054 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -162,8 +162,6 @@ jobs: image_name: - pulp-minimal - pulp - - galaxy-minimal - - galaxy steps: - uses: actions/checkout@v4 @@ -176,16 +174,16 @@ jobs: image_cache_key: ${{ needs.base-images.outputs.base_cache_key }} - name: Test App Image + if: matrix.image_variant != 'nightly' uses: "./.github/actions/test_image" with: image_name: ${{ matrix.image_name }} - image_variant: ${{ matrix.image_variant }} app_branch: ${{ steps.build_image.outputs.app_branch }} - name: Set tags run: | base_image=$(echo ${{ matrix.image_name }} | cut -d '-' -f1) - if [[ "${{ matrix.image_name }}" == "pulp" || "${{ matrix.image_name }}" == "galaxy" ]]; then + if [[ "${{ matrix.image_name }}" == "pulp" ]]; then images="${{ matrix.image_name }}" else images="${{ matrix.image_name }} ${base_image}-web" diff --git a/README.md b/README.md index 75a8b658..2d4bab0e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The [pulp-oci-images](https://github.com/pulp/pulp-oci-images) repository is use These images represent one of the officially supported Pulp installation methods. The available images can be divided into two types: -- [Multi-Process Images](multi-process-images) - Images for running a [Pulp](https://github.com/pulp/pulpcore) or [Ansible Galaxy](https://github.com/ansible/galaxy_ng), as well as its [third-party services](#third-party-services), +- [Multi-Process Images](multi-process-images) - Images for running a [Pulp](https://github.com/pulp/pulpcore), as well as its [third-party services](#third-party-services), in a single Docker/Podman container. - [Single-Process Images](single-process-images) - Images containing a single Pulp service each, which collectively make up a Pulp instance. They can be used via docker-compose or podman-compose, example [here](https://github.com/pulp/pulp-oci-images/tree/latest/images/compose). These images are also used by [pulp operator](https://pulpproject.org/pulp-operator/). @@ -22,9 +22,6 @@ See the [quickstart guide for deploying](https://pulpproject.org/pulp-oci-images | pulp | Multi-Process Pulp with several plugins | | pulp-minimal | Single-Process Pulp with several plugins | pulp-web | Webserver for pulp-minimal | -| galaxy | Multi-Process Ansible Galaxy | -| galaxy-minimal | Single-Process Ansible Galaxy | -| galaxy-web | Webserver for galaxy-minimal | ## First-Party Services diff --git a/images/galaxy-minimal/nightly/Containerfile.core b/images/galaxy-minimal/nightly/Containerfile.core deleted file mode 100644 index 76be60c0..00000000 --- a/images/galaxy-minimal/nightly/Containerfile.core +++ /dev/null @@ -1,16 +0,0 @@ -ARG FROM_TAG="latest" -FROM pulp/base:${FROM_TAG} - -RUN pip3 install \ - git+https://github.com/ansible/galaxy_ng \ - pulpcore[s3] \ - -c /constraints.txt && \ - rm -rf /root/.cache/pip - -USER pulp:pulp -RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ - /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link -USER root:root - -RUN chmod 2775 /var/lib/pulp/{scripts,media,tmp,assets} -RUN chown :root /var/lib/pulp/{scripts,media,tmp,assets} diff --git a/images/galaxy-minimal/nightly/Containerfile.webserver b/images/galaxy-minimal/nightly/Containerfile.webserver deleted file mode 100644 index 9f983ce9..00000000 --- a/images/galaxy-minimal/nightly/Containerfile.webserver +++ /dev/null @@ -1,20 +0,0 @@ -ARG FROM_TAG="nightly" -FROM pulp/galaxy-minimal:${FROM_TAG} as builder - -RUN mkdir -p /etc/nginx/pulp \ - /www/data -RUN ln $(pip3 show pulp_ansible | sed -n -e 's/Location: //p')/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf -RUN ln $(pip3 show pulp_container | sed -n -e 's/Location: //p')/pulp_container/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_container.conf -RUN ln $(pip3 show galaxy_ng | sed -n -e 's/Location: //p')/galaxy_ng/app/webserver_snippets/nginx.conf /etc/nginx/pulp/galaxy_ng.conf - -RUN cp -fr /usr/local/lib/python3.9/site-packages/galaxy_ng/app/static/galaxy_ng/. /www/data - - -FROM docker.io/centos/nginx-116-centos7:1.16 - - -COPY --from=builder /www/data . -COPY --from=builder /etc/nginx/pulp/*.conf "${NGINX_DEFAULT_CONF_PATH}"/ - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" diff --git a/images/galaxy-minimal/stable/Containerfile.core b/images/galaxy-minimal/stable/Containerfile.core deleted file mode 100644 index 9a8a75d5..00000000 --- a/images/galaxy-minimal/stable/Containerfile.core +++ /dev/null @@ -1,24 +0,0 @@ -ARG FROM_TAG="latest" -FROM pulp/base:${FROM_TAG} - -ARG PULPCORE_VERSION="" -ARG GALAXY_NG_VERSION="" - -RUN pip3 install --upgrade \ - galaxy-ng${GALAXY_NG_VERSION} \ - pulpcore[s3]${PULPCORE_VERSION} \ - -c /constraints.txt && \ - rm -rf /root/.cache/pip - -# Prevent pip-installed /usr/local/bin/pulp-content from getting run instead of -# our /usr/bin/pulp-content script. -RUN rm -f /usr/local/bin/pulp-content - -USER pulp:pulp -RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ - /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link && \ - chown -R 700 /var/lib/operator/static/ -USER root:root - -RUN chmod 2775 /var/lib/pulp/{scripts,media,tmp,assets} -RUN chown :root /var/lib/pulp/{scripts,media,tmp,assets} diff --git a/images/galaxy-minimal/stable/Containerfile.webserver b/images/galaxy-minimal/stable/Containerfile.webserver deleted file mode 100644 index ee682ab5..00000000 --- a/images/galaxy-minimal/stable/Containerfile.webserver +++ /dev/null @@ -1,20 +0,0 @@ -ARG FROM_TAG="stable" -FROM pulp/galaxy-minimal:${FROM_TAG} as builder - -RUN mkdir -p /etc/nginx/pulp \ - /www/data -RUN ln $(pip3 show pulp_ansible | sed -n -e 's/Location: //p')/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf -RUN ln $(pip3 show pulp_container | sed -n -e 's/Location: //p')/pulp_container/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_container.conf -RUN ln $(pip3 show galaxy_ng | sed -n -e 's/Location: //p')/galaxy_ng/app/webserver_snippets/nginx.conf /etc/nginx/pulp/galaxy_ng.conf - -RUN cp -fr /usr/local/lib/python3.9/site-packages/galaxy_ng/app/static/galaxy_ng/. /www/data - - -FROM docker.io/centos/nginx-116-centos7:1.16 - - -COPY --from=builder /www/data . -COPY --from=builder /etc/nginx/pulp/*.conf "${NGINX_DEFAULT_CONF_PATH}"/ - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" diff --git a/images/galaxy/nightly/Containerfile b/images/galaxy/nightly/Containerfile deleted file mode 100644 index 87259b20..00000000 --- a/images/galaxy/nightly/Containerfile +++ /dev/null @@ -1,24 +0,0 @@ -ARG FROM_TAG="latest" -FROM pulp/pulp-ci-centos9:${FROM_TAG} - -ARG GALAXY_NG_VERSION="" - -RUN pip3 install --upgrade \ - git+https://github.com/ansible/galaxy_ng.git@master \ - pulpcore[s3] \ - requests \ - -c /constraints.txt && \ - rm -rf /root/.cache/pip - -USER pulp:pulp -RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ - /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link -USER root:root - -RUN ln $(pip3 show pulp_ansible | sed -n -e 's/Location: //p')/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf -RUN ln $(pip3 show pulp_container | sed -n -e 's/Location: //p')/pulp_container/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_container.conf -RUN ln $(pip3 show galaxy_ng | sed -n -e 's/Location: //p')/galaxy_ng/app/webserver_snippets/nginx.conf /etc/nginx/pulp/galaxy_ng.conf - -# allow configuration via env variables -ENV S6_KEEP_ENV=1 -COPY images/galaxy/settings.py /etc/pulp/settings.py diff --git a/images/galaxy/settings.py b/images/galaxy/settings.py deleted file mode 100644 index e6616b57..00000000 --- a/images/galaxy/settings.py +++ /dev/null @@ -1,28 +0,0 @@ -import os - -_CONTAINER_ENV_CONFIGS = { - "API_PROTOCOL": "https" if os.getenv("PULP_HTTPS", default="false") == "true" else "http", - "API_HOST": os.getenv("GALAXY_HOSTNAME", default="localhost"), - "API_PORT": os.getenv("GALAXY_PORT", default="8080") -} - -CONTENT_ORIGIN='{API_PROTOCOL}://{API_HOST}:{API_PORT}'.format(**_CONTAINER_ENV_CONFIGS) -ALLOWED_EXPORT_PATHS=["/tmp"] -ALLOWED_IMPORT_PATHS=["/tmp"] - -GALAXY_API_PATH_PREFIX='/api/galaxy/' -GALAXY_DEPLOYMENT_MODE='standalone' -RH_ENTITLEMENT_REQUIRED='insights' -GALAXY_REQUIRE_CONTENT_APPROVAL=False - -ANSIBLE_API_HOSTNAME="{API_PROTOCOL}://{API_HOST}:{API_PORT}".format(**_CONTAINER_ENV_CONFIGS) -ANSIBLE_CONTENT_HOSTNAME="{API_PROTOCOL}://{API_HOST}:{API_PORT}/pulp/content".format(**_CONTAINER_ENV_CONFIGS) - -# Pulp container requires this to be set in order to provide docker registry -# compatible token authentication. -# https://docs.pulpproject.org/container/workflows/authentication.html -TOKEN_AUTH_DISABLED=False -TOKEN_SERVER="{API_PROTOCOL}://{API_HOST}:{API_PORT}/token/".format(**_CONTAINER_ENV_CONFIGS) -TOKEN_SIGNATURE_ALGORITHM="ES256" -PUBLIC_KEY_PATH="/etc/pulp/certs/token_public_key.pem" -PRIVATE_KEY_PATH="/etc/pulp/certs/token_private_key.pem" diff --git a/images/galaxy/stable/Containerfile b/images/galaxy/stable/Containerfile deleted file mode 100644 index 5a768ea1..00000000 --- a/images/galaxy/stable/Containerfile +++ /dev/null @@ -1,25 +0,0 @@ -ARG FROM_TAG="latest" -FROM pulp/pulp-ci-centos9:${FROM_TAG} - -ARG PULPCORE_VERSION="" -ARG GALAXY_NG_VERSION="" - -RUN pip3 install --upgrade \ - galaxy-ng${GALAXY_NG_VERSION} \ - pulpcore[s3]${PULPCORE_VERSION} \ - requests \ - -c /constraints.txt && \ - rm -rf /root/.cache/pip - -USER pulp:pulp -RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ - /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link -USER root:root - -RUN ln $(pip3 show pulp_ansible | sed -n -e 's/Location: //p')/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf -RUN ln $(pip3 show pulp_container | sed -n -e 's/Location: //p')/pulp_container/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_container.conf -RUN ln $(pip3 show galaxy_ng | sed -n -e 's/Location: //p')/galaxy_ng/app/webserver_snippets/nginx.conf /etc/nginx/pulp/galaxy_ng.conf - -# allow configuration via env variables -ENV S6_KEEP_ENV=1 -COPY images/galaxy/settings.py /etc/pulp/settings.py diff --git a/images/s6_assets/galaxy_ng_tests.sh b/images/s6_assets/galaxy_ng_tests.sh deleted file mode 100755 index c9003cea..00000000 --- a/images/s6_assets/galaxy_ng_tests.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -SERVER="localhost" -WEB_PORT="8080" -scheme=${1:-http} - -pip3 install "ansible<2.13.2" - -BASE_ADDR="$scheme://$SERVER:$WEB_PORT" -echo "Base Address: $BASE_ADDR" -REPOS=( "published" "staging" "rejected" "community" "rh-certified" ) -REPO_RESULTS=() - -echo "Waiting ..." -sleep 10 - -TOKEN=$(curl --insecure --location --request POST "$BASE_ADDR/api/galaxy/v3/auth/token/" --header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' --silent | jq -r .token) -echo $TOKEN - -echo "Testing ..." - -for repo in "${REPOS[@]}" -do - echo "Testing $repo" - COLLECTION_URL="$BASE_ADDR/api/galaxy/v3/plugin/ansible/content/$repo/collections/" - echo "Trying $COLLECTION_URL" - HTTP_CODE=$(curl --insecure --location --write-out "%{http_code}\n" -H "Authorization:Token $TOKEN" $COLLECTION_URL --silent --output /dev/null) - echo "Returned $HTTP_CODE" - REPO_RESULTS+=($HTTP_CODE) -done - -GALAXY_INIT_RESULT=0 -ITER=0 -for code in "${REPO_RESULTS[@]}" -do - echo "${REPOS[$ITER]} $code" - ITER=$((ITER + 1)) - if [[ $code != 200 ]]; then - GALAXY_INIT_RESULT=$ITER - fi -done - -exit $GALAXY_INIT_RESULT diff --git a/images/s6_assets/test.sh b/images/s6_assets/test.sh index 8dea24d7..44c08e1d 100755 --- a/images/s6_assets/test.sh +++ b/images/s6_assets/test.sh @@ -74,8 +74,4 @@ if [ "$old_image" != "" ]; then fi start_container_and_wait $image -if [[ ${image} != *"galaxy"* ]];then - source "$BASEDIR/pulp_tests.sh" $scheme -else - source "$BASEDIR/galaxy_ng_tests.sh" $scheme -fi +source "$BASEDIR/pulp_tests.sh" $scheme