diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d12aebc0f5..0394fc7f99 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -110,6 +110,30 @@ jobs: - name: Test k8s-bootstrap run: /bin/bash hooks/k8s-bootstrap/k8s-bootstrap-ondemand.sh test hooks/hook.env.example + docker-tests: + runs-on: ubuntu-latest + name: Docker tests + steps: + - name: Checkout ${{ github.sha }} + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.OSC_ROBOT_DOCKERHUB_USER }} + password: ${{ secrets.OSC_ROBOT_DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: false + file: packaging/container/Dockerfile + build-args: ['VERSION=3.1'] + tags: ohiosupercomputer/ondemand:latest + platforms: linux/amd64,linux/arm64 + e2e-tests: strategy: fail-fast: false diff --git a/Dockerfile b/Dockerfile index f4710784b8..d5e8c3bc1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,6 @@ RUN dnf -y update && \ ondemand-apache \ ondemand-ruby \ ondemand-nodejs \ - ondemand-python \ ondemand-dex \ ondemand-passenger \ ondemand-nginx && \ @@ -39,7 +38,7 @@ RUN mkdir -p /opt/ood RUN mkdir -p /var/www/ood/{apps,public,discover} RUN mkdir -p /var/www/ood/apps/{sys,dev,usr} -COPY docker/launch-ood /opt/ood/launch +COPY packaging/container/launch-ood /opt/ood/launch COPY mod_ood_proxy /opt/ood/mod_ood_proxy COPY nginx_stage /opt/ood/nginx_stage COPY ood-portal-generator /opt/ood/ood-portal-generator diff --git a/packaging/container/Dockerfile b/packaging/container/Dockerfile new file mode 100644 index 0000000000..c7e33545a6 --- /dev/null +++ b/packaging/container/Dockerfile @@ -0,0 +1,44 @@ +FROM rockylinux/rockylinux:8 +LABEL maintainer="tdockendorf@osc.edu; johrstrom@osc.edu" + +ARG VERSION=3.1 + +# setup the ondemand repositories +RUN dnf -y install https://yum.osc.edu/ondemand/${VERSION}/ondemand-release-web-${VERSION}-1.el8.noarch.rpm + +# install all the dependencies +RUN dnf -y update && \ + dnf install -y dnf-utils epel-release && \ + dnf config-manager --set-enabled powertools && \ + dnf -y module enable nodejs:18 ruby:3.1 && \ + dnf install -y \ + ondemand \ + ondemand-dex && \ + dnf clean all && rm -rf /var/cache/dnf/* + +COPY launch-ood /opt/ood/launch + +# copy configuration files +RUN mkdir -p /etc/ood/config +RUN cp /opt/ood/nginx_stage/share/nginx_stage_example.yml /etc/ood/config/nginx_stage.yml +RUN cp /opt/ood/ood-portal-generator/share/ood_portal_example.yml /etc/ood/config/ood_portal.yml + +# make some misc directories & files +RUN mkdir -p /var/lib/ondemand-nginx/config/apps/{sys,dev,usr} +RUN touch /var/lib/ondemand-nginx/config/apps/sys/{dashboard,shell,myjobs}.conf + +# setup sudoers for apache +RUN echo -e 'Defaults:apache !requiretty, !authenticate \n\ +Defaults:apache env_keep += "NGINX_STAGE_* OOD_*" \n\ +apache ALL=(ALL) NOPASSWD: /opt/ood/nginx_stage/sbin/nginx_stage' >/etc/sudoers.d/ood + +# run the OOD executables to setup the env +RUN /opt/ood/ood-portal-generator/sbin/update_ood_portal --insecure +RUN /opt/ood/nginx_stage/sbin/update_nginx_stage +# this one bc centos:8 doesn't generate localhost cert +RUN /usr/libexec/httpd-ssl-gencerts + +EXPOSE 8080 +EXPOSE 5556 +EXPOSE 3035 +CMD [ "/opt/ood/launch" ] diff --git a/docker/launch-ood b/packaging/container/launch-ood similarity index 100% rename from docker/launch-ood rename to packaging/container/launch-ood diff --git a/docker/ood_portal.yml b/packaging/container/ood_portal.yml similarity index 100% rename from docker/ood_portal.yml rename to packaging/container/ood_portal.yml