115 Commits

Author SHA1 Message Date
Chris Evich
6129365a19 Merge branch 'crun_workaround' into 'main'
Workaround crun oob_score_adj bug

Closes #7

See merge request qontainers/pipglr!24
2023-10-04 18:03:24 +00:00
Chris Evich
6b23c4d84a Workaround crun oob_score_adj bug
This commit can be reverted once a fixed version of crun is available.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-10-04 13:48:26 -04:00
Chris Evich
76ad69ccc8 Update CI/Build container to known-good version
Ref: https://github.com/containers/podman/discussions/19796

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-09-13 09:49:31 -04:00
Chris Evich
ecfb0040de Merge branch 'expand_nested_id_range' into 'main'
Fix <65535 IDs available to nested containers

Closes #3

See merge request qontainers/pipglr!22
v4.0.0
2023-04-26 15:04:42 +00:00
Chris Evich
7727884c55 Fix <65535 IDs available to nested containers
Fixes: #3

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-04-26 10:24:58 -04:00
Chris Evich
98dffa5af5 Merge branch 'linger_docs' into 'main'
Document need for enabling linger-mode

See merge request qontainers/pipglr!21
2023-03-02 19:12:55 +00:00
Chris Evich
e297613194 Document need for enabling linger-mode
Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-16 11:55:14 -05:00
Chris Evich
ae1d652f70 Merge branch 'fix_config' into 'main'
Fix registration permission denied

Closes #1

See merge request qontainers/pipglr!20
v3.0.1
2023-02-03 16:36:36 +00:00
Chris Evich
d66c563c31 Fix registration permission denied
For normal operations, the `runner` user's `.gitlab-runner` directory
has a symlink for (read-only) `config.toml` ->
`/var/run/secrets/config.toml`.  However, for during registration
attempts to write to this volume-mounted file result in a
`PANIC: write: permission denied` error.  Fix this by running the
registration as (namespaced) `root` user, and using the default config.
file location of `/etc/gitlab-runner`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-03 11:23:51 -05:00
Chris Evich
4927c6577c Merge branch 'improve_docs' into 'main'
Emphacise need to pre-create config.toml

See merge request qontainers/pipglr!19
2023-02-03 16:12:57 +00:00
Chris Evich
9d8c463a7f Emphacise need to pre-create config.toml
The README did not make it clear enough that a blank `config.toml` file
needs to be pre-created before runner registration.  Otherwise the
`register` *runlabel* will silently fail to bind-mount the file into the
proper location inside the container.

While we're at it, also add a small example of why it may be a good idea
to edit the `config.toml` file before commiting it as a secret.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-01-31 13:43:32 -05:00
Chris Evich
c6d67f583c Merge branch 'reimplement_systemd' into 'main'
Fix podman leaking conmon processes

See merge request qontainers/pipglr!18
2023-01-30 14:36:29 +00:00
Chris Evich
6cb20272e4 Fix podman leaking conmon processes
When running in the background without a full-blown init system,
`podman system service` will leak `conmon` processes for every
gitlab-runner job that executes via the docker socket API.  These
`conmon` processes almost immediately becomes zombies, and are never
cleaned up.  Eventually the zombies will consume all available PIDs.

Many attempts to fix this in various ways have all failed.  In all cases
the GitLab Runner process will start behaving strangely (or fail
completely) after an amount of time dependent on its usage executing
jobs.

Fix this by entirely reimplementing *pipglr* to utilize systemd and a
pair of lingering user-slices.  One for podman, another for the gitlab
runner.  Include a systemd timer service to affect runner cleanup,
periodically. Also update documentation and examples accordingly.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2023-01-28 09:59:59 -05:00
Chris Evich
f44e9891d1 Merge branch 'fix_idmaps' into 'main'
Fix newuidmap...`: newuidmap: open of uid_map failed: Permission denied

See merge request qontainers/pipglr!15
v3.0.0 v2.0.3
2022-12-08 12:05:44 +00:00
Chris Evich
bf242e8a52 Fix newuidmap...`: newuidmap: open of uid_map failed: Permission denied
Within a container, caps need to be set on /usr/bin/new{uid,gid}map
which reflect the (inner) podman user's root namespaced ID of 10000.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v2.0.2
2022-12-08 06:59:02 -05:00
Chris Evich
db6f2bceb9 Attempt fix v2.0.0 newuidmap permission denied
Recently, I believe an update or packaging problem has been causing
podman to throw errors like:

```
level=error msg="running `/usr/bin/newuidmap ...`: newuidmap: open of
uid_map failed: Permission denied\n"
```

This seems to have something to do with the shadow-utils package, which
owns this binary.  I've examined the file attribuites and permissions
along with /etc/sub{uid,gid} contents.  The only thing that seems to
resolve the issue is reinstalling shadow-utils.  Attempt that fix here
and hope it clears up the problem (present in v2.0.0)

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v2.0.1
2022-12-07 06:14:45 -05:00
Chris Evich
f1423ae0b2 Merge branch 'fix_volumes' into 'main'
Fix volume mounts

See merge request qontainers/pipglr!14
v2.0.0
2022-12-06 08:15:33 +00:00
Chris Evich
f88c1a43bd Fix volume mounts
* Add note about volume-mounts being cumulative with base-image
* Fix register & run labels to use (correct) base image's
  `/home/podman/.local/share/containers/` instead of defining
  a new (wrong/useless) `storage` volume.
* Fix register & run labels to mask over `/var/lib/containers`
  with a read-only tmpfs to block any nested rootful use of
  podman as a security precaution.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-12-06 03:07:40 -05:00
Chris Evich
5b28cca4e1 Merge branch 'docs_and_cache' into 'main'
Docs: Update volume creation section

See merge request qontainers/pipglr!13
2022-12-06 07:31:15 +00:00
Chris Evich
4fbe33bdbd Revert "Cache prior build layers for ~5 days"
This reverts commit 4c1af406f7.  For
whatever reason, trying to build this using the community runners always
results in an out-of-diskspace error.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-12-06 02:20:14 -05:00
Chris Evich
4c1af406f7 Cache prior build layers for ~5 days
This vastly improves build performance at the cost of some extra
registry server storage (which there is plenty of).   Note: The cache
TTL needs to be coordinated with the registry server's tag-cleanup
policy.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-12-06 02:18:55 -05:00
Chris Evich
51ce5e4e0a Use single uid/gid map
The podman base-image is intended to support running nested-podman both
root and rootless.  Since pipglr only ever runs rootless, eliminate the
nested usernamespace mapping needed to support nested-root usage.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-12-06 02:18:55 -05:00
Chris Evich
75bdc3196f Docs: Update volume creation section
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-12-06 02:18:27 -05:00
Chris Evich
d36e05d452 Merge branch 'add_readme' into 'main'
Include docs inside image

See merge request qontainers/pipglr!12
2022-12-01 19:23:04 +00:00
Chris Evich
29a806305e Include docs inside image
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-30 09:47:18 -05:00
Chris Evich
19a7e501be Docs update
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-30 09:44:34 -05:00
Chris Evich
b591a3d7c5 Remove broken workflow rules
They were preventing builds on main and on tags.  Rather than try and
debug them, just kill them as they're mostly unnecessary for this repo.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v1.4.2
2022-11-25 23:28:47 -05:00
Chris Evich
b21181a446 Fix build job not running on main or tag push
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v1.4.1
2022-11-25 23:26:35 -05:00
Chris Evich
c80dfffa14 Merge branch 'switch_to_buildah' into 'main'
Switch to using buildah

See merge request qontainers/pipglr!11
2022-11-26 04:20:51 +00:00
Chris Evich
cbb3eb0e22 Switch to using buildah
Observations show the runtime is about the same (since performance is mostly
storage-io bound.  However, buildah images are more compact and there
are simpler possibilities for build-caching available for future use.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v1.4.0
2022-11-25 23:15:26 -05:00
Chris Evich
98e2bee2a5 Merge branch 'kill_vars' into 'main'
Remove unnecessary variables

See merge request qontainers/pipglr!10
v1.3.0
2022-11-24 16:51:33 +00:00
Chris Evich
4b25e62b52 Remove unnecessary variables
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-24 11:48:23 -05:00
Chris Evich
1c08727c5d Merge branch 'simplify_metadata' into 'main'
Simplify image metadata

See merge request qontainers/pipglr!9
2022-11-24 02:41:37 +00:00
Chris Evich
af84720d71 Simplify image metadata
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-23 21:38:06 -05:00
Chris Evich
c748c4f928 Merge branch 'image_metadata' into 'main'
Add metadata to image

See merge request qontainers/pipglr!8
2022-11-24 01:47:48 +00:00
Chris Evich
5164551f98 Add metadata to image
Also, pin base image to a specific version instead of `latest`.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-23 18:54:24 -05:00
Chris Evich
63b00ad2e7 Merge branch 'fix_maintenance' into 'main'
Fix maintenance task

See merge request qontainers/pipglr!7
v1.2.1
2022-11-23 17:12:59 +00:00
Chris Evich
2bda4c3be6 Fix maintenance task
The function was defined but never called, resulting in immediate exit
of the maintenance script.  Fix this, also add a configuration build-arg and
ENV to control the cleaning interval.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-23 12:10:07 -05:00
Chris Evich
3b72178739 Merge branch 'cachevol' into 'main'
Add missing cache volume

See merge request qontainers/pipglr!6
2022-11-22 22:31:28 +00:00
Chris Evich
df8f46eb2d Update docs and Containerfile to match
Fully tested README.md instructions end-to-end on F36.

Signed-off-by: Chris Evich <cevich@redhat.com>
v1.2.0
2022-11-22 14:53:41 -05:00
Chris Evich
a1931efcc1 Add missing cache volume
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-22 11:35:36 -05:00
Chris Evich
3d6603945d Bugfix
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v1.1.2
2022-11-19 07:42:23 -05:00
Chris Evich
ae40196724 Pre-create podman storage root
Suspected cause of ownership problems when mounting a volume at this
location.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v1.1.1
2022-11-19 07:33:57 -05:00
Chris Evich
9cda05620b Merge branch 'docs' into 'main'
Support externally maintained DNF cache

See merge request qontainers/pipglr!5
v1.1.0
2022-11-19 10:52:12 +00:00
Chris Evich
cbddc54007 Resolve TODO, update volume names, update docs.
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-18 21:56:24 -05:00
Chris Evich
0e51bfdf8e Support externally maintained DNF cache
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-18 21:50:34 -05:00
Chris Evich
e5dfadbd4c Add wrapper error on podman start failure
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-18 09:04:05 -05:00
Chris Evich
b4dd3c667c Fix image tagging (again)
This CI environment is using a busybox `sh` so doesn't support all the
advanced features of bash.  Reimplement IMAGE_TAG processing so it
functions as intended.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
v1.0.1
2022-11-16 10:53:52 -05:00
Chris Evich
e214a0549c Merge branch 'bugfix' into 'main'
Fix CI/CD typo and other misc items

See merge request qontainers/pipglr!4
v1.0.0
2022-11-16 15:07:01 +00:00
Chris Evich
04b61422a9 Be helpful to CI/CD job maintainers
It's often hard to debug/maintain/improve a job when you can't observe
any of the (many!) auto-generated CI env. vars.  Print them all out on
every job.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-16 10:01:51 -05:00