Skip to content

Commit

Permalink
Merge pull request #76 from containers/containers-org
Browse files Browse the repository at this point in the history
Containers org
  • Loading branch information
k9withabone authored May 10, 2024
2 parents 75a9eaa + 7216a11 commit ffdbb03
Show file tree
Hide file tree
Showing 32 changed files with 383 additions and 280 deletions.
43 changes: 11 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -23,7 +23,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -33,45 +33,24 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose

build-container:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
container:
image: quay.io/containers/buildah:latest
options: --security-opt seccomp=unconfined --security-opt apparmor=unconfined --device /dev/fuse:rw
steps:
- name: Checkout
uses: actions/checkout@v3

# From https://podman.io/docs/installation#ubuntu
# There is a bug in earlier versions of buildah/podman where the TARGETPLATFORM arg is not set correctly
- name: Upgrade podman
run: |
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL \
"https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/Release.key" \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null && \
sudo apt update && \
sudo apt install -y podman
uses: actions/checkout@v4

- run: podman version

- id: conmon_version
run: echo version="$(conmon --version | head -n 1)" >> $GITHUB_OUTPUT
- run: buildah version

- name: Build ARM image
run: podman build --platform linux/arm64/v8 -t podlet .
run: buildah build --platform linux/arm64/v8 -t podlet .

- name: Build x86 image
run: podman build --platform linux/amd64 -t podlet .

- name: Test run image
# There is a regression in conmon v2.1.9 which causes this step to fail.
# See https://github.com/containers/conmon/issues/475
if: ${{ ! contains(steps.conmon_version.outputs.version, '2.1.9') }}
run: podman run localhost/podlet -h
run: buildah build --platform linux/amd64 -t podlet .
65 changes: 26 additions & 39 deletions .github/workflows/release-container.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,50 @@
# Builds and pushes container images upon realease
# Builds and pushes container images upon release
name: Release Container

on:
push:
tags:
- 'v[0-9]+*'
- "v[0-9]+*"

env:
MANIFEST: podlet-multiarch

jobs:
build-and-push:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
container:
image: quay.io/containers/buildah:latest
options: --security-opt seccomp=unconfined --security-opt apparmor=unconfined --device /dev/fuse:rw
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# From https://podman.io/docs/installation#ubuntu
# There is a bug in earlier versions of buildah/podman where the TARGETPLATFORM arg is not set correctly
- name: Upgrade podman
- run: buildah version

- name: Create manifest
run: |
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL \
"https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/Release.key" \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null && \
sudo apt update && \
sudo apt install -y podman
buildah manifest create \
--annotation "org.opencontainers.image.source=https://github.com/containers/podlet" \
--annotation "org.opencontainers.image.description=Generate Podman Quadlet files from a Podman command, compose file, or existing object" \
--annotation "org.opencontainers.image.licenses=MPL-2.0" \
"${MANIFEST}"
- run: podman version

- name: Build image
run: |
podman build --manifest "${MANIFEST}" \
buildah build --manifest "${MANIFEST}" \
--platform linux/amd64,linux/arm64/v8 -t podlet .
- name: Push to quay.io
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
run: |
podman manifest push "${MANIFEST}:latest" \
--creds "${USERNAME}:${PASSWORD}" \
"docker://quay.io/k9withabone/podlet:${GITHUB_REF_NAME}" && \
podman manifest push "${MANIFEST}:latest" \
--creds "${USERNAME}:${PASSWORD}" \
"docker://quay.io/k9withabone/podlet:latest"
- name: Push to docker.io
- name: Push to ghcr.io
env:
USERNAME: ${{ secrets.DOCKER_USERNAME }}
PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
podman manifest push "${MANIFEST}:latest" \
buildah manifest push "${MANIFEST}:latest" \
--creds "${USERNAME}:${PASSWORD}" \
"docker://docker.io/k9withabone/podlet:${GITHUB_REF_NAME}" && \
podman manifest push "${MANIFEST}:latest" \
"docker://ghcr.io/containers/podlet:${GITHUB_REF_NAME}" && \
buildah manifest push "${MANIFEST}:latest" \
--creds "${USERNAME}:${PASSWORD}" \
"docker://docker.io/k9withabone/podlet:latest"
"docker://ghcr.io/containers/podlet:latest"
70 changes: 35 additions & 35 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

### Features

- Set compatibility with `--podman-version` ([#45](https://github.com/k9withabone/podlet/issues/45))
- Add support for quadlet options introduced in podman v4.8.0 ([#30](https://github.com/k9withabone/podlet/issues/30))
- Set compatibility with `--podman-version` ([#45](https://github.com/containers/podlet/issues/45))
- Add support for Quadlet options introduced in Podman v4.8.0 ([#30](https://github.com/containers/podlet/issues/30))
- Container
- `GIDMap=`
- `ReadOnlyTmpfs=`
Expand All @@ -18,15 +18,15 @@
- `Image=`
- Image
- Brand new!
- Generate `.image` quadlet files with:
- Generate `.image` Quadlet files with:
- `podlet podman image pull`
- `podlet generate image`
- All quadlet file types
- All Quadlet file types
- `ContainersConfModule=`
- `GlobalArgs=`
- Convert relative host paths to absolute paths with `--absolute-host-paths` ([#52](https://github.com/k9withabone/podlet/issues/52))
- Does not affect paths in the `PodmanArgs=` quadlet option or Kubernetes YAML files.
- As part of the work to implement this, the following quadlet options are now fully parsed and validated:
- Convert relative host paths to absolute paths with `--absolute-host-paths` ([#52](https://github.com/containers/podlet/issues/52))
- Does not affect paths in the `PodmanArgs=` Quadlet option or Kubernetes YAML files.
- As part of the work to implement this, the following Quadlet options are now fully parsed and validated:
- `AddDevice=`
- `Mount=`
- `Rootfs=`
Expand All @@ -39,7 +39,7 @@

### Documentation

- *(readme)* Map user into podlet container ([#50](https://github.com/k9withabone/podlet/pull/50), thanks [@rugk](https://github.com/rugk)!)
- *(readme)* Map user into Podlet container ([#50](https://github.com/containers/podlet/pull/50), thanks [@rugk](https://github.com/rugk)!)
- *(readme)* Update demo, features, and usage

### Refactor
Expand All @@ -49,15 +49,15 @@

### Miscellaneous Tasks

- Add podman v4.9.0 to podman versions
- Add Podman v4.9.0 to Podman versions
- Update dependencies
- *(ci)* Update cargo-dist

## [0.2.3] - 2023-12-31

### Features

- Add support for quadlet options introduced in podman v4.7.0 ([#29](https://github.com/k9withabone/podlet/issues/29))
- Add support for Quadlet options introduced in Podman v4.7.0 ([#29](https://github.com/containers/podlet/issues/29))
- Container
- `DNS=`
- `DNSOption=`
Expand All @@ -69,14 +69,14 @@
- `AutoUpdate=`
- Network
- `DNS=`
- Add `podlet generate` subcommands for generating quadlet files from existing:
- Containers ([#23](https://github.com/k9withabone/podlet/issues/23))
- Add `podlet generate` subcommands for generating Quadlet files from existing:
- Containers ([#23](https://github.com/containers/podlet/issues/23))
- Networks
- Volumes

### Bug Fixes

- *(compose)* `network_mode` accept all podman values ([#38](https://github.com/k9withabone/podlet/issues/38))
- *(compose)* `network_mode` accept all Podman values ([#38](https://github.com/containers/podlet/issues/38))
- Improved error message for unsupported values
- *(network)* Support `<start-IP>-<end-IP>` syntax for `--ip-range`

Expand All @@ -95,9 +95,9 @@

### Features

- Add support for quadlet options introduced in podman v4.6.0 ([#28](https://github.com/k9withabone/podlet/issues/28))
- Add support for Quadlet options introduced in Podman v4.6.0 ([#28](https://github.com/containers/podlet/issues/28))
- Container
- `Sysctl=` ([#22](https://github.com/k9withabone/podlet/pull/22), thanks [@b-rad15](https://github.com/b-rad15)!)
- `Sysctl=` ([#22](https://github.com/containers/podlet/pull/22), thanks [@b-rad15](https://github.com/b-rad15)!)
- `AutoUpdate=`
- `HostName=`
- `Pull=`
Expand All @@ -112,11 +112,11 @@
### Bug Fixes

- *(container)* Arg `--tls-verify` requires =
- *(network)* Filter out empty `Options=` quadlet option
- Escape newlines in joined quadlet values ([#32](https://github.com/k9withabone/podlet/issues/32))
- *(compose)* Support `cap_drop`, `userns_mode`, and `group_add` service fields ([#31](https://github.com/k9withabone/podlet/issues/31), [#34](https://github.com/k9withabone/podlet/issues/34))
- *(compose)* Split `command` string ([#36](https://github.com/k9withabone/podlet/issues/36))
- When the command is converted to the `Exec=` quadlet option, it is now properly quoted. When converting to k8s, it is properly split into args.
- *(network)* Filter out empty `Options=` Quadlet option
- Escape newlines in joined Quadlet values ([#32](https://github.com/containers/podlet/issues/32))
- *(compose)* Support `cap_drop`, `userns_mode`, and `group_add` service fields ([#31](https://github.com/containers/podlet/issues/31), [#34](https://github.com/containers/podlet/issues/34))
- *(compose)* Split `command` string ([#36](https://github.com/containers/podlet/issues/36))
- When the command is converted to the `Exec=` Quadlet option, it is now properly quoted. When converting to k8s, it is properly split into args.

### Documentation

Expand All @@ -126,7 +126,7 @@
### Refactor

- Use custom serializer for `PodmanArgs=`
- Use custom serializer for quadlet sections
- Use custom serializer for Quadlet sections

### Miscellaneous Tasks

Expand All @@ -136,23 +136,23 @@

### Features

- Compose: Read compose file from stdin ([#18](https://github.com/k9withabone/podlet/discussions/18))
- For `podlet compose`, if a compose file is not provided and stdin is not a terminal, or `-` is provided, podlet will attempt to read a compose file from stdin.
- Compose: Read compose file from stdin ([#18](https://github.com/containers/podlet/discussions/18))
- For `podlet compose`, if a compose file is not provided and stdin is not a terminal, or `-` is provided, Podlet will attempt to read a compose file from stdin.
- For example `cat compose-example.yaml | podlet compose` or `cat compose-example.yaml | podlet compose -`

### Bug Fixes

- Truncate when overwriting existing files
- Compose service volumes can be mixed long and short form ([#26](https://github.com/k9withabone/podlet/issues/26))
- Compose service volumes can be mixed long and short form ([#26](https://github.com/containers/podlet/issues/26))

### Documentation

- Readme: Add sample podlet container usage instructions ([#17](https://github.com/k9withabone/podlet/pull/17), thanks [@Nitrousoxide](https://github.com/Nitrousoxide)!)
- Readme: Add sample Podlet container usage instructions ([#17](https://github.com/containers/podlet/pull/17), thanks [@Nitrousoxide](https://github.com/Nitrousoxide)!)
- Readme: Update description, add build and local ci instructions

### Miscellaneous Tasks

- CI: Update podman for build and publish of container
- CI: Update Podman for build and publish of container
- CI: Add container builds to regular checks
- Update dependencies
- CI: Update cargo-dist to v0.5.0
Expand All @@ -175,11 +175,11 @@

### Added

- Check for existing systemd unit files with the same name as the service generated by quadlet from the podlet generated quadlet file and throw an error if there is a conflict ([#14](https://github.com/k9withabone/podlet/issues/14)).
- Check for existing systemd unit files with the same name as the service generated by Quadlet from the Podlet generated Quadlet file and throw an error if there is a conflict ([#14](https://github.com/containers/podlet/issues/14)).
- Use `--skip-services-check` to opt-out.
- Convert a (docker) compose file ([#9](https://github.com/k9withabone/podlet/issues/9)) to:
- Multiple quadlet files
- A pod with a quadlet kube file and Kubernetes YAML
- Convert a (docker) compose file ([#9](https://github.com/containers/podlet/issues/9)) to:
- Multiple Quadlet files
- A pod with a Quadlet kube file and Kubernetes YAML

### Changed

Expand All @@ -189,17 +189,17 @@

### Added

- A container image of podlet now available on [quay.io](https://quay.io/repository/k9withabone/podlet) and [docker hub](https://hub.docker.com/r/k9withabone/podlet).
- Option flag for outputting to podman unit directory `--unit-directory`.
- Places the generated file in the appropriate directory (i.e. `/etc/containers/systemd`, `~/.config/containers/systemd`) for use by quadlet.
- A container image of Podlet now available on [quay.io](https://quay.io/repository/k9withabone/podlet) and [docker hub](https://hub.docker.com/r/k9withabone/podlet).
- Option flag for outputting to Podman unit directory `--unit-directory`.
- Places the generated file in the appropriate directory (i.e. `/etc/containers/systemd`, `~/.config/containers/systemd`) for use by Quadlet.

## [0.1.0] - 2023-04-14

The initial release of podlet! Designed for podman v4.5.0 and newer.
The initial release of Podlet! Designed for Podman v4.5.0 and newer.

### Initial Features

- Create quadlet files:
- Create Quadlet files:
- `.container` - `podman run`
- `.kube` - `podman kube play`
- `.network` - `podman network create`
Expand Down
3 changes: 3 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## The Podlet Project Community Code of Conduct

The Podlet project follows the [Containers Community Code of Conduct](https://github.com/containers/common/blob/main/CODE-OF-CONDUCT.md).
Loading

0 comments on commit ffdbb03

Please sign in to comment.