-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
434 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2021.08.26-228-g9949044 | ||
2021.08.26-232-g10acbaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if [[ " ${SCENARIOS[*]} " =~ " ${TEST} " ]]; then | ||
# Needed by pulp_container/tests/functional/api/test_flatpak.py: | ||
cmd_prefix dnf install -yq dbus-daemon flatpak | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# WARNING: DO NOT EDIT! | ||
# | ||
# This file was generated by plugin_template, and is managed by it. Please use | ||
# './plugin-template --github pulp_container' to update this file. | ||
# | ||
# For more info visit https://github.com/pulp/plugin_template | ||
|
||
import requests | ||
import yaml | ||
import random | ||
import os | ||
|
||
|
||
def random_color(): | ||
"""Generates a random 24-bit number in hex""" | ||
color = random.randrange(0, 2**24) | ||
return format(color, "06x") | ||
|
||
|
||
session = requests.Session() | ||
token = os.getenv("GITHUB_TOKEN") | ||
|
||
headers = { | ||
"Authorization": f"token {token}", | ||
"Accept": "application/vnd.github+json", | ||
"X-GitHub-Api-Version": "2022-11-28", | ||
} | ||
session.headers.update(headers) | ||
|
||
# get all labels from the repository's current state | ||
response = session.get("https://api.github.com/repos/pulp/pulp_container/labels", headers=headers) | ||
assert response.status_code == 200 | ||
old_labels = set([x["name"] for x in response.json() if x["name"].startswith("backport-")]) | ||
|
||
# get ci_update_branches from template_config.yml | ||
with open("./template_config.yml", "r") as f: | ||
plugin_template = yaml.safe_load(f) | ||
new_labels = set(["backport-" + x for x in plugin_template["ci_update_branches"]]) | ||
|
||
# delete old labels that are not in new labels | ||
for label in old_labels.difference(new_labels): | ||
response = session.delete( | ||
f"https://api.github.com/repos/pulp/pulp_container/labels/{label}", headers=headers | ||
) | ||
assert response.status_code == 204 | ||
|
||
# create new labels that are not in old labels | ||
for label in new_labels.difference(old_labels): | ||
color = random_color() | ||
response = session.post( | ||
"https://api.github.com/repos/pulp/pulp_container/labels", | ||
headers=headers, | ||
json={"name": label, "color": color}, | ||
) | ||
assert response.status_code == 201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# WARNING: DO NOT EDIT! | ||
# | ||
# This file was generated by plugin_template, and is managed by it. Please use | ||
# './plugin-template --github pulp_container' to update this file. | ||
# | ||
# For more info visit https://github.com/pulp/plugin_template | ||
|
||
|
||
--- | ||
name: Update Labels | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'template_config.yml' | ||
|
||
jobs: | ||
update_backport_labels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.8" | ||
- name: Configure Git with pulpbot name and email | ||
run: | | ||
git config --global user.name 'pulpbot' | ||
git config --global user.email '[email protected]' | ||
- name: Install python dependencies | ||
run: | | ||
echo ::group::PYDEPS | ||
pip install requests pyyaml | ||
echo ::endgroup:: | ||
- uses: actions/checkout@v3 | ||
- name: Update labels | ||
run: | | ||
python3 .github/workflows/scripts/update_backport_labels.py | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added support for Flatpak index endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.. _flatpak-workflow: | ||
|
||
Hosting Flatpak Content in OCI Format | ||
===================================== | ||
|
||
Pulp can host Flatpak application and runtime images that are distributed in OCI format. To make | ||
such content discoverable, it can provide ``/index/dynamic`` and ``/index/static`` endpoints as | ||
specified by `the Flatpak registry index protocol | ||
<https://github.com/flatpak/flatpak-oci-specs/blob/main/registry-index.md>`_. This is not enabled | ||
by default. To enable it, define ``FLATPAK_INDEX = True`` in the settings file. | ||
|
||
Clients like the ``flatpak`` command-line tool or the GNOME Software application will typically | ||
query the ``/index/static`` endpoint, which is intended to be called repeatedly with identical query | ||
parameters, and whose responses are meant to be cached. The ``/index/dynamic`` endpoint serves | ||
exactly the same content, but is intended for one-off requests that should not be cached. These | ||
endpoints can be accessed without authentication. They only provide information about public | ||
repositories. | ||
|
||
The two endpoints support a number of query parameters (``architecture``, ``tag``, ``label``, etc.), | ||
see the protocol specification for details. Two notes: | ||
|
||
* Every request must include a ``label:org.flatpak.ref:exists=1`` query parameter. This acts as a | ||
marker to only report Flatpak content, and to exclude other container content that may also be | ||
provided by the Pulp instance. | ||
|
||
* This implementation does not support annotations. Including any ``annotation`` query parameters | ||
will result in a 400 failure response. Use ``label`` query parameters instead. (Existing clients | ||
like the ``flatpak`` command-line tool never issue requests including any ``annotation`` query | ||
parameters.) | ||
|
||
Install a Flatpak image from Pulp | ||
--------------------------------- | ||
|
||
This section assumes that you have created at least one public distribution in your Pulp instance | ||
that serves a repository containing Flatpak content. To do this, see the general :doc:`host` | ||
documentation. | ||
|
||
You can for example use the ``flatpak`` `command-line tool | ||
<https://docs.flatpak.org/en/latest/using-flatpak.html#the-flatpak-command>`_ to set up a Flatpak | ||
remote (named ``pulp`` here) that references your Pulp instance: | ||
|
||
.. code:: shell | ||
flatpak remote-add pulp oci+"$BASE_ADDR" | ||
Then, use | ||
|
||
.. code:: shell | ||
flatpak remote-ls pulp | ||
to retrieve a list of all Flatpak applications and runtimes that your Pulp instance serves. (This | ||
queries the ``/index/static`` endpoint, as explained above.) Finally, if your Pulp instance serves | ||
e.g. the ``org.gnome.gedit`` application, use | ||
|
||
.. code:: shell | ||
flatpak install pulp org.gnome.gedit | ||
to install it and run it with | ||
|
||
.. code:: shell | ||
flatpak run org.gnome.gedit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,4 @@ OCI artifact support | |
cosign-support | ||
helm-support | ||
oci-artifacts | ||
flatpak-support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.