Skip to content

Commit

Permalink
Test build for #1050
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak authored and SUSE Update Bot committed May 15, 2024
1 parent 756c781 commit 554629c
Show file tree
Hide file tree
Showing 23 changed files with 241 additions and 27 deletions.
7 changes: 7 additions & 0 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ staging_build:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: openjdk-22-devel-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: packaging-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: pcp-image
Expand Down Expand Up @@ -306,6 +310,9 @@ refresh_devel_BCI:
- trigger_services:
project: devel:BCI:Tumbleweed
package: openjdk-22-devel-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: packaging-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: pcp-image
Expand Down
2 changes: 1 addition & 1 deletion busybox-image/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openSUSE Tumbleweed BCI openSUSE Tumbleweed BusyBox: the smallest and GPLv3-free image
# openSUSE Tumbleweed BCI BusyBox: the smallest and GPLv3-free image
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)


Expand Down
6 changes: 3 additions & 3 deletions busybox-image/busybox-image.kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
<description type="system">
<author>openSUSE Project</author>
<contact>https://www.suse.com/</contact>
<specification>openSUSE Tumbleweed BCI openSUSE Tumbleweed BusyBox Container Image</specification>
<specification>openSUSE Tumbleweed BCI BusyBox Container Image</specification>
</description>
<preferences>
<type image="docker">
Expand All @@ -32,8 +32,8 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
additionaltags="%OS_VERSION_ID_SP%.%RELEASE%,latest">
<labels>
<suse_label_helper:add_prefix prefix="org.opensuse.bci.busybox">
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed BCI openSUSE Tumbleweed BusyBox"/>
<label name="org.opencontainers.image.description" value="openSUSE Tumbleweed BusyBox container based on the openSUSE Tumbleweed Base Container Image."/>
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed BCI BusyBox"/>
<label name="org.opencontainers.image.description" value="BusyBox container based on the openSUSE Tumbleweed Base Container Image."/>
<label name="org.opencontainers.image.version" value="%OS_VERSION_ID_SP%.%RELEASE%"/>
<label name="org.opencontainers.image.created" value="%BUILDTIME%"/>
<label name="org.opencontainers.image.vendor" value="openSUSE Project"/>
Expand Down
7 changes: 7 additions & 0 deletions gcc-12-image/_constraints
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<constraints>
<hardware>
<disk>
<size unit="G">6</size>
</disk>
</hardware>
</constraints>
7 changes: 7 additions & 0 deletions gcc-13-image/_constraints
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<constraints>
<hardware>
<disk>
<size unit="G">6</size>
</disk>
</hardware>
</constraints>
7 changes: 7 additions & 0 deletions gcc-14-image/_constraints
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<constraints>
<hardware>
<disk>
<size unit="G">6</size>
</disk>
</hardware>
</constraints>
2 changes: 1 addition & 1 deletion git-image/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The openSUSE Tumbleweed openSUSE Tumbleweed with Git Container Image
# The openSUSE Tumbleweed with Git Container Image
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)


Expand Down
4 changes: 2 additions & 2 deletions git-image/git-image.kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
<description type="system">
<author>openSUSE Project</author>
<contact>https://www.suse.com/</contact>
<specification>openSUSE Tumbleweed openSUSE Tumbleweed with Git Container Image</specification>
<specification>openSUSE Tumbleweed with Git Container Image</specification>
</description>
<preferences>
<type image="docker" derived_from="obsrepositories:/opensuse/bci/bci-micro#latest">
Expand All @@ -32,7 +32,7 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
additionaltags="%%git_version%%-%RELEASE%,latest">
<labels>
<suse_label_helper:add_prefix prefix="org.opensuse.application.git">
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed openSUSE Tumbleweed with Git"/>
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed with Git"/>
<label name="org.opencontainers.image.description" value="A micro environment with Git based on the openSUSE Tumbleweed Base Container Image."/>
<label name="org.opencontainers.image.version" value="%%git_version%%"/>
<label name="org.opencontainers.image.created" value="%BUILDTIME%"/>
Expand Down
2 changes: 1 addition & 1 deletion init-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MAINTAINER openSUSE (https://www.opensuse.org/)

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=org.opensuse.bci.init
LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI openSUSE Tumbleweed Init"
LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI Init"
LABEL org.opencontainers.image.description="Systemd environment for containers based on the openSUSE Tumbleweed Base Container Image. This container is only supported with podman."
LABEL org.opencontainers.image.version="%OS_VERSION_ID_SP%.%RELEASE%"
LABEL org.opencontainers.image.url="https://www.opensuse.org"
Expand Down
2 changes: 1 addition & 1 deletion init-image/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The openSUSE Tumbleweed BCI openSUSE Tumbleweed Init Container Image
# The openSUSE Tumbleweed BCI Init Container Image
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)


Expand Down
6 changes: 3 additions & 3 deletions mariadb-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ By default, the image launches MariaDB with the same configuration that comes wi
The only environment variable required to start the container is the MariaDB root password.

```ShellSession
$ podman run -it --rm -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:%%mariadb_version%%
$ podman run -it --rm -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:latest
```

or:

```ShellSession
$ podman run -it --rm -p 3306:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 registry.opensuse.org/opensuse/mariadb:%%mariadb_version%%
$ podman run -it --rm -p 3306:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 registry.opensuse.org/opensuse/mariadb:latest
```

### Volumes
Expand All @@ -31,7 +31,7 @@ When using the MariaDB image, we recommend one of the following options:
To mount a host directory as a volume for your data run the following command:

```ShellSession
$ podman run -it --rm -v /my/own/datadir:/var/lib/mysql:Z -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:%%mariadb_version%%
$ podman run -it --rm -v /my/own/datadir:/var/lib/mysql:Z -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:latest
```

The `-v /my/own/datadir:/var/lib/mysql:Z` part of the command mounts the `/my/own/datadir` directory from the underlying host system as `/var/lib/mysql` inside the container, where MariaDB will by default write its data files.
Expand Down
2 changes: 1 addition & 1 deletion micro-image/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openSUSE Tumbleweed BCI openSUSE Tumbleweed Micro: Suitable for deploying static binaries
# openSUSE Tumbleweed BCI Micro: Suitable for deploying static binaries
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)


Expand Down
4 changes: 2 additions & 2 deletions micro-image/micro-image.kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
<description type="system">
<author>openSUSE Project</author>
<contact>https://www.suse.com/</contact>
<specification>openSUSE Tumbleweed BCI openSUSE Tumbleweed Micro Container Image</specification>
<specification>openSUSE Tumbleweed BCI Micro Container Image</specification>
</description>
<preferences>
<type image="docker">
Expand All @@ -32,7 +32,7 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
additionaltags="%OS_VERSION_ID_SP%.%RELEASE%,latest">
<labels>
<suse_label_helper:add_prefix prefix="org.opensuse.bci.micro">
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed BCI openSUSE Tumbleweed Micro"/>
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed BCI Micro"/>
<label name="org.opencontainers.image.description" value="A micro environment for containers based on the openSUSE Tumbleweed Base Container Image."/>
<label name="org.opencontainers.image.version" value="%OS_VERSION_ID_SP%.%RELEASE%"/>
<label name="org.opencontainers.image.created" value="%BUILDTIME%"/>
Expand Down
2 changes: 1 addition & 1 deletion minimal-image/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openSUSE Tumbleweed BCI openSUSE Tumbleweed Minimal: Base Container image without Zypper
# openSUSE Tumbleweed BCI Minimal: Base Container image without Zypper
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)


Expand Down
6 changes: 3 additions & 3 deletions minimal-image/minimal-image.kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
<description type="system">
<author>openSUSE Project</author>
<contact>https://www.suse.com/</contact>
<specification>openSUSE Tumbleweed BCI openSUSE Tumbleweed Minimal Container Image</specification>
<specification>openSUSE Tumbleweed BCI Minimal Container Image</specification>
</description>
<preferences>
<type image="docker" derived_from="obsrepositories:/opensuse/bci/bci-micro#latest">
Expand All @@ -32,8 +32,8 @@ You can contact the BCI team via https://github.com/SUSE/bci/discussions
additionaltags="%OS_VERSION_ID_SP%.%RELEASE%,latest">
<labels>
<suse_label_helper:add_prefix prefix="org.opensuse.bci.minimal">
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed BCI openSUSE Tumbleweed Minimal"/>
<label name="org.opencontainers.image.description" value="openSUSE Tumbleweed Minimal container based on the openSUSE Tumbleweed Base Container Image."/>
<label name="org.opencontainers.image.title" value="openSUSE Tumbleweed BCI Minimal"/>
<label name="org.opencontainers.image.description" value="Minimal container based on the openSUSE Tumbleweed Base Container Image."/>
<label name="org.opencontainers.image.version" value="%OS_VERSION_ID_SP%.%RELEASE%"/>
<label name="org.opencontainers.image.created" value="%BUILDTIME%"/>
<label name="org.opencontainers.image.vendor" value="openSUSE Project"/>
Expand Down
51 changes: 51 additions & 0 deletions packaging-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-License-Identifier: MIT

# Copyright (c) 2024 SUSE LLC

# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon.

# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
# It is maintained by the BCI team and generated by
# https://github.com/SUSE/BCI-dockerfile-generator

# Please submit bugfixes or comments via https://bugs.opensuse.org/
# You can contact the BCI team via https://github.com/SUSE/bci/discussions


#!BuildTag: opensuse/osc:%%osc_version%%
#!BuildTag: opensuse/osc:%%osc_version%%-%RELEASE%
#!BuildTag: opensuse/osc:latest

FROM opensuse/tumbleweed:latest

MAINTAINER openSUSE (https://www.opensuse.org/)

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=org.opensuse.application.osc
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Packaging"
LABEL org.opencontainers.image.description="Packaging container based on the openSUSE Tumbleweed Base Container Image."
LABEL org.opencontainers.image.version="%%osc_version%%"
LABEL org.opencontainers.image.url="https://www.opensuse.org"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="openSUSE Project"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/packaging-image/README.md"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/osc:%%osc_version%%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime"
LABEL org.opensuse.release-stage="released"

# endlabelprefix
LABEL run="podman run --rm -it -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z IMAGE"
LABEL runcwd="podman run --rm -it -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z -v .:/root/osc-workdir:z IMAGE"

RUN set -euo pipefail; zypper -n in --no-recommends osc obs-service-appimage obs-service-cargo obs-service-cdi_containers_meta obs-service-compose_kiwi_description obs-service-docker_label_helper obs-service-download_assets obs-service-download_files obs-service-download_url obs-service-extract_file obs-service-format_spec_file obs-service-go_modules obs-service-kiwi_label_helper obs-service-kiwi_metainfo_helper obs-service-kubevirt_containers_meta obs-service-node_modules obs-service-obs_scm cpio obs-service-product_converter obs-service-recompress obs-service-refresh_patches obs-service-replace_using_env obs-service-replace_using_package_version obs-service-set_version obs-service-snapcraft obs-service-source_validator obs-service-tar obs-service-tar_scm obs-service-verify_file openSUSE-release openSUSE-release-appliance-docker git openssh-common openssh-clients; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/bin/bash"]
WORKDIR /root/osc-workdir
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

VOLUME /var/tmp
105 changes: 105 additions & 0 deletions packaging-image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# OSC Packaging Container

![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)


This is the openSUSE packaging container image, it includes all the necessary
software to create and modify packages in the [Open Build
Service](https://build.opensuse.org/) using
[osc](https://github.com/openSUSE/osc/).


## How to use this container image

This container image is intended for interactive usage with your `.oscrc` and
the osc cookiejar mounted into the container:

```ShellSession
# podman run --rm -it \
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:rw,z \
registry.opensuse.org/opensuse/osc:latest
```

The above command launches an interactive shell where your local osc config will
be used. You can then proceed to checkout packages, perform modifications and
send submissions to OBS.

To work on an already checked out package, mount the current working directory:

```ShellSession
# podman run --rm -it \
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
-v .:/root/osc-workdir:z \
registry.opensuse.org/opensuse/osc:latest
```

The container entrypoint recognizes whether you are launching it for interactive
usage or whether you are invoking `osc` directly. For convenience, you can omit
the command `osc` in the second case. E.g.:

```ShellSession
# podman run --rm -it \
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
-v .:/root/osc-workdir:z \
registry.opensuse.org/opensuse/osc:latest ls openSUSE:Factory
```

The above command will automatically invoke forward the arguments to `osc` and
call `osc ls openSUSE:Factory`.


### Using the image labels

The image provides two labels `run` and `runcwd` which include the full command
to run the `osc` container or run it with the local working directory mounted as
well.

These labels can be shown via:

```ShellSession
# podman container runlabel run --display registry.opensuse.org/opensuse/osc:latest
# podman container runlabel runcwd --display registry.opensuse.org/opensuse/osc:latest
```

Note that it is currently not yet possible to execute these labels with podman.


### Connecting to build.suse.de

build.suse.de uses a ssh based authentication and thus requires additional
resources to be available in the container. Additionally, you have to provide
the internal certificate to the container as well:

```ShellSession
# podman run --rm -it \
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
-v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \
-v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \
-e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \
-v "$PWD":/root/osc-workdir:z \
registry.opensuse.org/opensuse/osc:latest
```


## Limitations

- It is currently not possible to build packages in a container.


## Volumes

The container image is preconfigured to put `/var/tmp` into a volume. This
directory is used by `osc` to store the buildroot and the package cache.

## Licensing
`SPDX-License-Identifier: MIT`

The build recipe and this documentation is licensed as MIT.
The container itself contains various software components under various open source licenses listed in the associated
Software Bill of Materials (SBOM).

This image is based on [openSUSE Tumbleweed](https://get.opensuse.org/tumbleweed/).
9 changes: 9 additions & 0 deletions packaging-image/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<services>
<service mode="buildtime" name="docker_label_helper"/>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%osc_version%%</param>
<param name="package">osc</param>
</service>
</services>
17 changes: 17 additions & 0 deletions packaging-image/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [[ ! -e /root/.config/osc/oscrc ]]; then
cat << EOF
This container is expected to be launched with your oscrc mounted to
/root/.config/osc/oscrc
Please consult the README or the label 'run' for the full invocation.
EOF
fi

if [[ "-h --help -v --verbose -q --quiet --debug --debugger --post-mortem --traceback -H --http-debug --http-full-debug -A --apiurl --config --setopt --no-keyring add addchannels addcontainers addremove ar aggregatepac api branch getpac bco branchco browse build wipe shell chroot buildconfig buildhistory buildhist buildinfo buildlog buildlogtail blt bl cat less blame changedevelrequest changedevelreq cr checkconstraints checkout co clean cleanassets ca clone comment commit checkin ci config copypac create-pbuild-config cpc createincident createrequest creq delete remove del rm deleterequest deletereq droprequest dropreq dr dependson detachbranch develproject dp bsdevelproject diff di ldiff linkdiff distributions dists downloadassets da enablechannels enablechannel fork getbinaries help importsrcpkg info init jobhistory jobhist linkpac linktobranch list LL lL ll ls localbuildlog lbl lock log maintainer bugowner maintenancerequest mr mbranch maintained sm meta mkpac mv my patchinfo pdiff prdiff projdiff projectdiff prjresults pr pull pull_request rdelete rdiff rebuild rebuildpac release releaserequest remotebuildlog remotebuildlogtail rbuildlogtail rblt rbuildlog rbl repairlink repairwc repo repositories platforms repos repourls request review rq requestmaintainership reqbs reqms reqmaintainership requestbugownership reqbugownership resolved restartbuild abortbuild results r revert rpmlintlog lint rpmlint rremove search bse se sendsysrq service setdevelproject sdp setlinkrev showlinked signkey staging status st submitrequest submitpac submitreq sr token triggerreason tr undelete unlock update up updatepacmetafromspec updatepkgmetafromspec metafromspec vc version whatdependson whois user who wipebinaries unpublish workerinfo" =~ (^|[[:space:]])$1($|[[:space:]]) ]]; then
# looks like the user is executing the container as the osc command
osc "$@"
else
exec "$@"
fi
4 changes: 4 additions & 0 deletions packaging-image/packaging-image.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Wed May 15 15:48:59 UTC 2024 - SUSE Update Bot <[email protected]>

- First version of the Packaging BCI
Loading

0 comments on commit 554629c

Please sign in to comment.