Skip to content

Commit

Permalink
Merge branch 'feature/portus-2.5-fix' into develop
Browse files Browse the repository at this point in the history
Purpose of this Release : Sharing a finally successfully built `portus:2.5` container, workingon SUSE/Portus#2241
  • Loading branch information
pegasus.devops committed Mar 1, 2020
2 parents a9e1021 + b817062 commit 1534110
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 87 deletions.
65 changes: 38 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Portus OCI container images library
# Pokus! [Portus](#) OCI container images library

## Why

Expand All @@ -8,32 +8,52 @@ very soon, ended up fixing multiple issues with other community users like :
* https://github.com/Ashtonian
* https://github.com/diranged
* https://github.com/robgiovanardi
* https://github.com/shqear93
* https://github.com/ogra
* The nice https://github.com/Kulturserver Tech Team, and Alex Klotz

You may read examples of those issues here : https://github.com/SUSE/Portus/issues?utf8=%E2%9C%93&q=is%3Aissue+lasselle

All in all I finally decided to re-design
All in all, we had many problems, most of them becoming hellfests because of lack of industrialization, or communication on it.

So I finally decided to re-design the whole devops factory for portus.

This repo is one of the many repo required to run that Devops factory.

## What is this

This repo contains all defintions of :
* the OCI container images to run [`Portus`](https://github.com/SUSE/portus)
* all of the images you will find in this repo are modifications of OCI image defintions from https://github.com/openSUSE/docker-containers
* https://github.com/openSUSE/docker-containers is mirrored by a repo I own, https://gitlab.com/pokus-io/opensuse/docker-containers
* the difference is that for every release of this repo :
* for every OCI image defintion, the release notes give an exiting tag, on the https://gitlab.com/pokus-io/opensuse/docker-containers repository
* All of the images you will find in this repo are modifications or fix of OCI image defintions from https://github.com/openSUSE/docker-containers
* For every release of this repo :
* for every OCI image defintion, the release notes give an existing tag, on the https://gitlab.com/pokus-io/opensuse/docker-containers repository
* so this tag points at an inambiguous commit hash from https://github.com/openSUSE/docker-containers
*

## Releases Bill Of Material


### Release `0.0.1` :

## Versioning rules

* The release numbers on this repo are _SEMVER_-compliant
* Additionnaly to its relase version number, each release of this repo will be tagged with at least one tag of the form `portus-${PORTUS_RELEASE_VER}`, where `${PORTUS_RELEASE_VER}` is an existing Portus Release Tag. These tags will help you filter among this repo's releases, and find docker images for the version of Portus you are working with.

## Releases

### Release `0.0.1` : Bill Of Material

_Purpose of this Release : sharing a finally successfully built `portus:2.5` container_

Here are the released (fixed) openSUSE `Portus` OCI container images :

| Image name | Component of | Notes |
|------------------------ |----------------- |------------------ |
| `opensuzie/portus:2.5` | `portus` | `OpenSUSE` Team publishes that with generic mame `opensuse/portus:2.5` |

This release is therefore tagged `portus-2.5`

Tag marking the exact version from which the `0.0.1` relase of `opensuzie/portus:2.5` : https://gitlab.com/pokus-io/opensuse/docker-containers/-/tags/DEVOPS_PORTUS_2.5_REPAIRMAN


## How to use

### Building a `portus` image
Expand All @@ -42,30 +62,21 @@ This image is used torun both the main `portus` server, and its `background` com

To build a release of that container, execute the following :

```bash

```bash
export SUZIE_OCI_LIBRARY_RELEASE=0.0.1
export SUZIE_OCI_LIBRARY_GIT_URI=git@github.com:pokusio/opensuzie-oci-library.git
export SUZIE_OCI_LIBRARY_GIT_URI="https://github.com/pokusio/opensuzie-oci-library.git"
export WORK_FOLDER=$(mktemp -d /tmp/suzie.oci.library.XXXXXXXX)
# define image tag
export PORTUS_RELEASE_TAG=${PORTUS_RELEASE_TAG:-'opensuzie/portus:2.5'}
git clone

#!/bin/sh

export PORTUS_RELEASE_TAG=${PORTUS_RELEASE_TAG:-'opensuzie/portus:2.5'}

export DOCKER_BUILD_CONTEXT=docker-containers/derived_images/portus

set +x
git clone $SUZIE_OCI_LIBRARY_GIT_URI $WORK_FOLDER
cd $WORK_FOLDER
git checkout $SUZIE_OCI_LIBRARY_RELEASE

git clone git@gitlab.com:second-bureau/pegasus/docker/docker-containers.git
docker build library/portus -t $PORTUS_RELEASE_TAG


sed -i "s#15.0#15.1#g" Dockerfile
```

echo "--------------------------------"
echo "reset lines in Dockerfile : "
echo "--------------------------------"
cat Dockerfile |grep '15.1'
echo "--------------------------------"
docker build $DOCKER_BUILD_CONTEXT -t opensuzie/portus:2.5
### Building a `registry` image (soon)
41 changes: 41 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

### Release `0.0.1` : Bill Of Material

_Purpose of this Release : Sharing a finally successfully built `portus:2.5` container, workingon https://github.com/SUSE/Portus/issues/2241_

Here are the released (fixed) openSUSE `Portus` OCI container images :

| Image name | Component of | Notes |
|------------------------ |----------------- |------------------ |
| `opensuzie/portus:2.5` | `portus` | `OpenSUSE` Team publishes that with generic mame `opensuse/portus:2.5` |

This release is therefore tagged `portus-2.5`

Tag marking the exact version from which the `0.0.1` relase of `opensuzie/portus:2.5` : https://gitlab.com/pokus-io/opensuse/docker-containers/-/tags/DEVOPS_PORTUS_2.5_REPAIRMAN


## How to use

### Building a `portus` image

This image is used torun both the main `portus` server, and its `background` companion.

To build a release of that container, execute the following :


```bash
export SUZIE_OCI_LIBRARY_RELEASE=0.0.1
export SUZIE_OCI_LIBRARY_GIT_URI=git@github.com:pokusio/opensuzie-oci-library.git
export SUZIE_OCI_LIBRARY_GIT_URI="https://github.com/pokusio/opensuzie-oci-library.git"
export WORK_FOLDER=$(mktemp -d /tmp/suzie.oci.library.XXXXXXXX)
# define image tag
export PORTUS_RELEASE_TAG=${PORTUS_RELEASE_TAG:-'opensuzie/portus:2.5'}

git clone $SUZIE_OCI_LIBRARY_GIT_URI $WORK_FOLDER
cd $WORK_FOLDER
git checkout $SUZIE_OCI_LIBRARY_RELEASE

docker build library/portus -t $PORTUS_RELEASE_TAG


```
2 changes: 1 addition & 1 deletion documentation/collaborate/contribute/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to contribute
# How to contribute (not fully tested yet, planned for release `0.0.3`)

You must use the `git-flow`, `AVH Edition`, to contribute :
* Any pull request not following the git-flow will be discarded
Expand Down
2 changes: 1 addition & 1 deletion documentation/collaborate/management/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Collaboration Management on this repo
# Collaboration Management on this repo (not fully tested yet, planned for release `0.0.3`)


## Initializing the repo
Expand Down
59 changes: 1 addition & 58 deletions documentation/collaborate/team/developers/README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,4 @@
# IAAC this template


* Là :

```bash
export COLLABORATION_MGMT_BRANCH=develop

# ---
# Where to download the setup script;

export SSH_URI_TO_GIT_REPO=git@github.com:pokusio/opensuzie-oci-library.git

git clone $SSH_URI_TO_GIT_REPO

export PATH="${PATH}:$(pwd)/documentation/collaborate/team/developers/develop.sh"

$(pwd)/documentation/collaborate/team/developers/develop.sh

```

* or :

```bash
# export GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa'
export THIS_GIT_URI=git@github.com:pokusio/opensuzie-oci-library.git
export WORK_DIR=$(mktemp -d ~/pegasus.git.templates.library.dev.XXXXXXXX)

export FEATURE_ALIAS="mafonctionnalite"

git clone $THIS_GIT_URI $WORK_DIR
cd $WORK_DIR
git flow init --defaults


export COMMIT_MESSAGE_PS1='Resuming'

git checkout $FEATURE_ALIAS || export COMMIT_MESSAGE_PS1='Starting' && git flow init start $FEATURE_ALIAS

git push -u origin HEAD
git pull -u origin --all


export GFLOW_FEATURE_BRANCH_PREFIX=$(git flow config|grep Feature|awk '{print $NF}')
export CURRENT_FEATURE_BRANCH=$(git branch -a | grep -v 'remotes' | grep $GFLOW_FEATURE_BRANCH_PREFIX |awk '{print $2}')

export COMMIT_MESSAGE=""
export COMMIT_MESSAGE="$COMMIT_MESSAGE ${COMMIT_MESSAGE_PS1} work on [$CURRENT_FEATURE_BRANCH]"

# git add --all && git commit -m "$COMMIT_MESSAGE" && git push -u origin HEAD
```


Below there an example content for the root `README.md`

---

# The developer guide
# The developer guide (not fully tested yet, planned for release `0.0.3`)

You must use the `git-flow`, `AVH Edition`, to contribute :
* Any pull request not following the git-flow will be discarded
Expand Down
43 changes: 43 additions & 0 deletions library/portus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM opensuse/leap:15.1
MAINTAINER SUSE Containers Team <containers@suse.com>

# Install the entrypoint of this image.
COPY init /

# Install Portus and prepare the /certificates directory.
RUN chmod +x /init && \
# Fetch the key from the obs://Virtualization:containers:Portus
# project. Sometimes the key server times out or has some other problem. In
# that case, we fall back to alternative key servers.
TMPDIR=/tmp/build && \
mkdir -m 0600 $TMPDIR && \
for key in 55A0B34D49501BB7CA474F5AA193FBB572174FC2 \
A9EA39C49B6B9E93B6863F849AF0C9A20E9AF123; do \
found=''; \
for server in \
hkp://keys.gnupg.net:80 \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo "Fetching GPG key $GPG_KEY from $server"; \
gpg --homedir $TMPDIR --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "error: failed to fetch GPG key $key" && exit 1; \
gpg --homedir $TMPDIR --export --armor $key > $TMPDIR/repo.key && \
rpm --import $TMPDIR/repo.key ; \
done; \
rm -rf $TMPDIR && \
# Now add the repository and install portus.
zypper ar -f obs://devel:languages:ruby/openSUSE_Leap_15.1 ruby && \
zypper ar -p 1 -f obs://Virtualization:containers:Portus/openSUSE_Leap_15.1 portus && \
zypper ref -f && \
zypper -n in --from portus --details ruby-common portus && \
zypper clean -a && \
# Prepare the certificates directory.
rm -rf /etc/pki/trust/anchors && \
ln -sf /certificates /etc/pki/trust/anchors

EXPOSE 3000
ENTRYPOINT ["/init"]
43 changes: 43 additions & 0 deletions library/portus/Dockerfile.opensuse.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM opensuse/leap:15.0
MAINTAINER SUSE Containers Team <containers@suse.com>

# Install the entrypoint of this image.
COPY init /

# Install Portus and prepare the /certificates directory.
RUN chmod +x /init && \
# Fetch the key from the obs://Virtualization:containers:Portus
# project. Sometimes the key server times out or has some other problem. In
# that case, we fall back to alternative key servers.
TMPDIR=/tmp/build && \
mkdir -m 0600 $TMPDIR && \
for key in 55A0B34D49501BB7CA474F5AA193FBB572174FC2 \
A9EA39C49B6B9E93B6863F849AF0C9A20E9AF123; do \
found=''; \
for server in \
hkp://keys.gnupg.net:80 \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo "Fetching GPG key $GPG_KEY from $server"; \
gpg --homedir $TMPDIR --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "error: failed to fetch GPG key $key" && exit 1; \
gpg --homedir $TMPDIR --export --armor $key > $TMPDIR/repo.key && \
rpm --import $TMPDIR/repo.key ; \
done; \
rm -rf $TMPDIR && \
# Now add the repository and install portus.
zypper ar -f obs://devel:languages:ruby/openSUSE_Leap_15.0 ruby && \
zypper ar -p 1 -f obs://Virtualization:containers:Portus/openSUSE_Leap_15.0 portus && \
zypper ref -f && \
zypper -n in --from portus --details ruby-common portus && \
zypper clean -a && \
# Prepare the certificates directory.
rm -rf /etc/pki/trust/anchors && \
ln -sf /certificates /etc/pki/trust/anchors

EXPOSE 3000
ENTRYPOINT ["/init"]
Empty file added library/portus/README.md
Empty file.
Loading

0 comments on commit 1534110

Please sign in to comment.