Skip to content

Commit

Permalink
Migrate to ghcr
Browse files Browse the repository at this point in the history
Issue: OSIS-146
  • Loading branch information
francoisferrand committed Apr 26, 2024
1 parent 57ec0d9 commit 588c034
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 43 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,13 @@ name: docker-build
on:
workflow_call:
inputs:
namespace:
required: false
type: string
default: osis-dev
tag:
required: false
type: string
default: "${{ github.sha }}"
registry:
required: false
type: string
default: registry.scality.com
secrets:
REGISTRY_LOGIN:
required: true
REGISTRY_PASSWORD:
required: true

env:
NAMESPACE: ${{ inputs.namespace }}
TAG: ${{ inputs.tag }}
REGISTRY: ${{ inputs.registry }}

jobs:
build:
Expand All @@ -42,16 +27,16 @@ jobs:
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and push development docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/osis:${{ env.TAG }}
tags: ghcr.io/${{ github.repository }}:${{ env.TAG }}
cache-from: type=gha,scope=osis
cache-to: type=gha,mode=max,scope=osis
build-args: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
uses: ./.github/workflows/docker-build.yml
with:
namespace: osis
tag: ${{ github.event.inputs.tag }}
secrets:
REGISTRY_LOGIN: ${{ secrets.REGISTRY_LOGIN }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}

github-release:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ jobs:
contents: read
packages: write
uses: ./.github/workflows/docker-build.yml
secrets:
REGISTRY_LOGIN: ${{ secrets.REGISTRY_LOGIN }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}

trivy:
needs: build
name: Trivy Vulnerability Scan for Code
uses: scality/workflows/.github/workflows/trivy.yaml@v1
with:
name: osis
namespace: osis-dev
registry: registry.scality.com
name: ${{ github.event.repository.name }}
namespace: ${{ github.repository_owner }}
registry: ghcr.io
3 changes: 0 additions & 3 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
docker-build:
name: Development docker image
uses: ./.github/workflows/docker-build.yml
secrets:
REGISTRY_LOGIN: ${{ secrets.REGISTRY_LOGIN }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}

code_coverage:
name: code coverage
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ This project is for OSIS, which integrates [Scality RING](https://www.scality.co
```
Dev:
```sh
$ docker pull registry.scality.com/vmware-ose-scality-dev/vmware-ose-scality:<short SHA-1 commit hash>
docker pull ghcr.io/scality/osis:<short SHA-1 commit hash>
```
Production image:
```sh
$ docker pull registry.scality.com/vmware-ose-scality/vmware-ose-scality:<tag>
docker pull ghcr.io/scality/osis:<tag>
```
1. Generate a self-signed SSL certificate and store it in a binary PKCS#12 format file with extension `.p12` file. (Refer [here](#To-generate-PKCS12-file-for-self-signed-SSL-certificate))

Expand Down Expand Up @@ -57,7 +57,7 @@ This project is for OSIS, which integrates [Scality RING](https://www.scality.co
-v <absolute_path_to_.p12_file>:/app/lib/osis.p12:ro,z \
-v <absolute_path_to_crypto.yml_file>:/conf/crypto.yml:ro,z \
-v <absolute_path_to_application.properties_file>:/conf/application.properties:ro,z \
registry.scality.com/vmware-ose-scality-dev/vmware-ose-scality:<short SHA-1 commit hash>
ghcr.io/scality/osis:<short SHA-1 commit hash>
```
Production image:
```sh
Expand All @@ -68,7 +68,7 @@ This project is for OSIS, which integrates [Scality RING](https://www.scality.co
-v <absolute_path_to_.p12_file>:/app/lib/osis.p12:ro,z \
-v <absolute_path_to_crypto.yml_file>:/conf/crypto.yml:ro,z \
-v <absolute_path_to_application.properties_file>:/conf/application.properties:ro,z \
registry.scality.com/vmware-ose-scality/vmware-ose-scality:<tag>
ghcr.io/scality/osis:<tag>
```
Expand Down
11 changes: 5 additions & 6 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Docker Image generation

Docker images are hosted on registry.scality.com.
It has two names spaces for Vmware-ose-scality:
Docker images are hosted on ghcr.io/scality.
It has one image:

* Production Namespace: registry.scality.com/vmware-ose-scality
* Dev Namespace: registry.scality.com/vmware-ose-scality-dev
* Production container image: ghcr.io/scality/osis

Production namespace provides write access to a few admins and CI while read
access is given to all the developers. Dev namespace provides write access
Expand All @@ -17,8 +16,8 @@ images to be used by developers, CI builds, build chain and so on.
## How to pull docker images

```sh
docker pull registry.scality.com/vmware-ose-scality-dev/vmware-ose-scality:<short SHA-1 commit hash>
docker pull registry.scality.com/vmware-ose-scality/vmware-ose-scality:<tag>
docker pull ghcr.io/scality/osis:<short SHA-1 commit hash>
docker pull ghcr.io/scality/osis:<tag>
```

## Release Process
Expand Down
4 changes: 2 additions & 2 deletions docs/milestone-2-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ docker restart scality-vault-1
- Pull this docker image. Use the latest commit from thew repository as SHA in the below command.
```sh
docker pull registry.scality.com/vmware-ose-scality-dev/vmware-ose-scality:<SHA>
docker pull ghcr.io/scality/osis:<SHA>

```
Expand Down Expand Up @@ -105,7 +105,7 @@ docker pull registry.scality.com/vmware-ose-scality-dev/vmware-ose-scality:<SHA>
-p 8443:8443 \
-v /root/keyStore.p12:/app/lib/osis.p12:ro,z \
-v /root/crypto.yml:/app/config/crypto.yml:ro,z \
registry.scality.com/vmware-ose-scality-dev/vmware-ose-scality:<SHA1>
ghcr.io/scality/osis:<SHA1>
```
Note: For S3 Connector, use the host network as shows in the example above.
Expand Down

0 comments on commit 588c034

Please sign in to comment.