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

Converge cloudserver images #5716

Open
wants to merge 4 commits into
base: development/9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 16 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,6 @@ env:
PROJECT_NAME: ${{ github.event.repository.name }}

jobs:
build-federation-image:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push image for federation
uses: docker/build-push-action@v5
with:
push: true
context: .
file: images/svc-base/Dockerfile
tags: |
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}-svc-base
cache-from: type=gha,scope=federation
cache-to: type=gha,mode=max,scope=federation

release:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -69,6 +45,22 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push federation image
uses: docker/build-push-action@v5
with:
push: true
context: images/federation
provenance: false
build-args:
CLOUDSERVER_VERSION=${{ github.event.inputs.tag }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}-federation
labels: |
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
cache-from: type=gha,scope=federation
cache-to: type=gha,mode=max,scope=federation

- name: Create Release
uses: softprops/action-gh-release@v2
env:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Login to GitHub Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and push cloudserver image
uses: docker/build-push-action@v5
with:
Expand All @@ -177,6 +180,23 @@ jobs:
git.commit-sha=${{ github.sha }}
cache-from: type=gha,scope=cloudserver
cache-to: type=gha,mode=max,scope=cloudserver

- name: Build and push federation image
uses: docker/build-push-action@v5
with:
push: true
context: images/federation
provenance: false
build-args:
CLOUDSERVER_VERSION=${{ github.sha }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}-federation
francoisferrand marked this conversation as resolved.
Show resolved Hide resolved
labels: |
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
cache-from: type=gha,scope=federation
cache-to: type=gha,mode=max,scope=federation

- name: Build and push pykmip image
uses: docker/build-push-action@v5
with:
Expand All @@ -189,6 +209,7 @@ jobs:
git.commit-sha=${{ github.sha }}
cache-from: type=gha,scope=pykmip
cache-to: type=gha,mode=max,scope=pykmip

- name: Build and push MongoDB
uses: docker/build-push-action@v5
with:
Expand Down
42 changes: 42 additions & 0 deletions images/federation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG CLOUDSERVER_VERSION=latest
FROM ghcr.io/scality/cloudserver:${CLOUDSERVER_VERSION} AS builder

####################################################################################################
FROM ghcr.io/scality/cloudserver:${CLOUDSERVER_VERSION} AS supervisord

ARG SUPERVISORD_VERSION=0.7.3
ADD https://github.com/ochinchina/supervisord/releases/download/v${SUPERVISORD_VERSION}/supervisord_${SUPERVISORD_VERSION}_Linux_64-bit.tar.gz /tmp/supervisord.tar.gz
RUN tar -xzvf /tmp/supervisord.tar.gz -C /usr/local/bin --strip-components 1 --wildcards '*/supervisord'

####################################################################################################
FROM ghcr.io/scality/cloudserver:${CLOUDSERVER_VERSION}

# Install external dependencies
COPY --from=supervisord /usr/local/bin/supervisord /usr/local/bin/

# Prepare runtime environment
ENV USER="scality"
ENV HOME_DIR="/home/${USER}" \
LOG_DIR="/logs" \
CONF_DIR="/conf" \
DATA_DIR="/data" \
SUP_RUN_DIR="/var/run/supervisor"

RUN mv /home/node ${HOME_DIR} && usermod --login ${USER} --shell /bin/bash -d ${HOME_DIR} node
RUN mkdir ${LOG_DIR} && chown ${USER} ${LOG_DIR} && \
mkdir ${CONF_DIR} && chown ${USER} ${CONF_DIR} && \
mkdir ${DATA_DIR} && chown ${USER} ${DATA_DIR} && \
mkdir -m 777 ${SUP_RUN_DIR} && chown ${USER} ${SUP_RUN_DIR}

USER ${USER}
WORKDIR ${HOME_DIR}/s3

# Keep same output as chown command without group (use group 0)
COPY --chown=${USER}:0 --from=builder /usr/src/app ${HOME_DIR}/cloudserver

ENV S3_CONFIG_FILE=${CONF_DIR}/config.json
ENV S3_LOCATION_FILE=${CONF_DIR}/locationConfig.json
EXPOSE 8000

CMD [ "/bin/bash", "-c", "source ${CONF_DIR}/env && export && exec supervisord -c ${CONF_DIR}/supervisord.conf" ]
ENTRYPOINT []
28 changes: 0 additions & 28 deletions images/svc-base/Dockerfile

This file was deleted.

Loading