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

WIP: create an osc container for package maintenance #1050

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dcermak
Copy link
Collaborator

@dcermak dcermak commented Apr 24, 2024

No description provided.

dcermak added a commit that referenced this pull request Apr 24, 2024
dirkmueller
dirkmueller previously approved these changes Apr 25, 2024
Copy link
Member

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. tumbleweed rules!

@dmach
Copy link

dmach commented Apr 26, 2024

The container image looks relatively good, but still needs couple changes work nicely:

  • Unset OSC_APIURL otherwise it's not going to work with any other apiurl.
  • Install packages: openssh-common openssh-clients
  • Maybe also install git
  • Update Containerfile with WORKDIR /root/osc-workdir
  • drop the current entry point? maybe replace it with printing instructions how to use the container

The following command that works for me nicely:

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 \
    -v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,Z \
    -v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:rw,Z \
    -e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:rw,Z \
    -v "$PWD":/root/osc-workdir:rw,Z \
    osc:latest "$@"

The containers shares the following with the host: oscrc, cookiejar, ca certificates, ssh-agent socket and working dir (essential for checkout and other commands; will not work if a command expects project in parent directory, but that's not a common use case, I think)

dcermak added a commit that referenced this pull request Apr 26, 2024
dcermak added a commit that referenced this pull request Apr 26, 2024
dcermak added a commit that referenced this pull request Apr 26, 2024
dcermak added a commit that referenced this pull request Apr 27, 2024
dcermak added a commit that referenced this pull request Apr 29, 2024
dcermak added a commit that referenced this pull request Apr 29, 2024
dcermak added a commit that referenced this pull request Apr 29, 2024
dcermak added a commit that referenced this pull request May 6, 2024
dcermak added a commit that referenced this pull request May 6, 2024
dcermak added a commit that referenced this pull request May 6, 2024
dcermak added a commit that referenced this pull request May 15, 2024
dcermak added a commit that referenced this pull request May 15, 2024
dcermak added a commit that referenced this pull request May 15, 2024
dcermak added a commit that referenced this pull request May 15, 2024
Copy link

github-actions bot commented May 15, 2024

Created a staging project on OBS for Tumbleweed: home:defolos:BCI:Staging:Tumbleweed:Tumbleweed-1050
Changes pushed to branch Tumbleweed-1050 as commit 1c370e6e6dd15cb7f78cb875028eb17d7d1a305e
Build succeeded ✅

Build Results

Repository images in home:defolos:BCI:Staging:Tumbleweed:Tumbleweed-1050 for x86_64: current state: published
Build results:

package name status build log
packaging-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:Tumbleweed:Tumbleweed-1050 for aarch64: current state: published
Build results:

package name status build log
packaging-image ⛔ excluded live log

Repository containerfile in home:defolos:BCI:Staging:Tumbleweed:Tumbleweed-1050 for x86_64: current state: published
Build results:

package name status build log
packaging-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:Tumbleweed:Tumbleweed-1050 for aarch64: current state: published
Build results:

package name status build log
packaging-image ✅ succeeded live log

Build succeeded ✅

To run BCI-tests against this PR, use the following command:

OS_VERSION=tumbleweed TARGET=custom BASEURL=registry.opensuse.org/home/defolos/bci/staging/tumbleweed/tumbleweed-1050/ tox -- -n auto
The following images can be pulled from the staging project:
  • registry.opensuse.org/home/defolos/bci/staging/tumbleweed/tumbleweed-1050/containerfile/opensuse/osc:latest

@dcermak dcermak requested a review from dmach September 3, 2024 13:43
@dcermak dcermak marked this pull request as ready for review September 3, 2024 13:43
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
Copy link

github-actions bot commented Sep 4, 2024

Created a staging project on OBS for 6: home:defolos:BCI:Staging:SLE-15-SP6:6-1050
Changes pushed to branch 6-1050 as commit b503dc54c800f68aff8cf1dbdee5cfbbd6a51daa
Build succeeded ✅

Build Results

Repository images in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for x86_64: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for aarch64: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for s390x: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for ppc64le: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for x86_64: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for aarch64: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for s390x: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP6:6-1050 for ppc64le: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Build succeeded ✅

To run BCI-tests against this PR, use the following command:

OS_VERSION=15.6 TARGET=custom BASEURL=registry.opensuse.org/home/defolos/bci/staging/sle-15-sp6/6-1050/ tox -- -n auto
The following images can be pulled from the staging project:
  • registry.opensuse.org/home/defolos/bci/staging/sle-15-sp6/6-1050/containerfile/suse/mariadb
  • registry.opensuse.org/home/defolos/bci/staging/sle-15-sp6/6-1050/containerfile/suse/rmt-mariadb
⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️

Copy link

github-actions bot commented Sep 4, 2024

Created a staging project on OBS for 7: home:defolos:BCI:Staging:SLE-15-SP7:7-1050
Changes pushed to branch 7-1050 as commit 33f87a454602679333f1330fb94f8be40e8add9f
Build succeeded ✅

Build Results

Repository images in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for x86_64: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for aarch64: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for s390x: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository images in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for ppc64le: current state: published
Build results:

package name status build log
rmt-mariadb-image ⛔ excluded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for x86_64: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for aarch64: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for s390x: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Repository containerfile in home:defolos:BCI:Staging:SLE-15-SP7:7-1050 for ppc64le: current state: published
Build results:

package name status build log
rmt-mariadb-image ✅ succeeded live log

Build succeeded ✅

To run BCI-tests against this PR, use the following command:

OS_VERSION=15.7 TARGET=custom BASEURL=registry.opensuse.org/home/defolos/bci/staging/sle-15-sp7/7-1050/ tox -- -n auto
The following images can be pulled from the staging project:
  • registry.opensuse.org/home/defolos/bci/staging/sle-15-sp7/7-1050/containerfile/suse/mariadb
  • registry.opensuse.org/home/defolos/bci/staging/sle-15-sp7/7-1050/containerfile/suse/rmt-mariadb
⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️ ⚠️⚠️ Project and Branch have been deleted ⚠️⚠️

dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 4, 2024
dcermak pushed a commit that referenced this pull request Sep 5, 2024
dcermak pushed a commit that referenced this pull request Sep 11, 2024
dcermak pushed a commit that referenced this pull request Sep 11, 2024
dcermak pushed a commit that referenced this pull request Sep 11, 2024
src/bci_build/package/osc/README.md.j2 Outdated Show resolved Hide resolved
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like, but it can be misleading.

What if I want to cat or ls a file inside the container?
It will assume it is an osc command, instead of calling regular binaries in the PATH.

I can start a regular shell session and execute binaries, that is an easy solution, or perhaps use /bin/ls or similar to invoke the binary directly.

src/bci_build/package/appcontainers.py Show resolved Hide resolved
Co-authored-by: Dmitri Popov <[email protected]>
Co-authored-by: Daniel Mach <[email protected]>
dcermak pushed a commit that referenced this pull request Sep 12, 2024
@dcermak
Copy link
Collaborator Author

dcermak commented Sep 12, 2024

WIP tests PR: SUSE/BCI-tests#593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants