Skip to content

Commit

Permalink
Add containerfile for resalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Siteshwar Vashisht <[email protected]>
  • Loading branch information
siteshwar committed Mar 14, 2024
1 parent 834f284 commit d9197d9
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- add-resalloc-container
jobs:
build-and-push:
runs-on: ubuntu-20.04
Expand All @@ -19,3 +20,17 @@ jobs:
docker_context: "containers"
image_name: "ocp"
tag: "staging"
build-and-push-resalloc:
runs-on: ubuntu-20.04
steps:
- name: Build and push to quay.io registry
uses: sclorg/build-and-push-action@v4
with:
registry: "quay.io"
registry_namespace: "openscanhub-fedora-infra"
registry_username: ${{ secrets.REGISTRY_LOGIN }}
registry_token: ${{ secrets.REGISTRY_TOKEN }}
dockerfile: "containers/resalloc-server.Containerfile"
docker_context: "containers"
image_name: "resalloc-server"
tag: "staging"
3 changes: 3 additions & 0 deletions containers/configs/aws-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default]
region = us-west-2
output = table
49 changes: 49 additions & 0 deletions containers/resalloc-server.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# TODO: Check if we can use ubi.
# resalloc dependencies require a subscription.
# FROM registry.access.redhat.com/ubi9/ubi
FROM quay.io/centos/centos:stream9
USER 0

RUN dnf install -y dnf-plugins-core
RUN dnf config-manager --set-enabled crb extras-common

RUN dnf install -y epel-release

# Deployment instructions are described here
# https://github.com/praiskup/resalloc/blob/master/docs/start-resalloc-server.txt

RUN dnf install -y ansible \
findutils \
openssh-clients \
postgresql \
python3-psycopg2 \
resalloc \
resalloc-aws \
resalloc-server \
sqlite \
vim \
&& dnf clean all

# copy filesystem setup
# COPY files/ /

# `/etc/resallocserver/` belongs to `resalloc` group and is not readable by `root`.
RUN chgrp -R root /etc/resallocserver/ /var/log/resallocserver /var/lib/resallocserver
RUN chmod -R g+rwx /etc/resallocserver/ /var/log/resallocserver /var/lib/resallocserver

# Set up aws configurations. Ssh key would be mounted from OpenShift.
RUN mkdir /var/lib/resallocserver/.aws /var/lib/resallocserver/.ssh
COPY configs/aws-config /var/lib/resallocserver/.aws/config

# `server.yaml` and `pools.yaml` are mount through OpenShift configurations.
RUN rm -f /etc/resallocserver/server.yaml /etc/resallocserver/pools.yaml

# TODO: This should be probably done through `COPY` from the same repository.
RUN git clone --branch openscanhub-fedora-infra https://pagure.io/forks/svashisht/rhcopr/vm-provisioning.git /etc/resallocserver/vm-provisioning
RUN git clone --branch main https://github.com/siteshwar/openscanhub-deployment-configs.git /etc/resallocserver/openscanhub-deployment-configs

USER 1001
ENV HOME=/var/lib/resallocserver
ENV CONFIG_DIR=/etc/resallocserver
CMD /usr/bin/resalloc-server
# CMD sleep inf

0 comments on commit d9197d9

Please sign in to comment.