Commit graph

9 commits

Author SHA1 Message Date
Achilleas Koutsou
15dbb90eda upload/pulp: wait for tasks in UploadAndDistributeCommit
When uploading and distributing a commit, wait for any async tasks to
finish before returning.  There are two tasks that can block this
function:
- Creating a distribution: this only happens when a new repository is
  created.
- Import commit: this will always happen in this function.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
cfddd448c3 osbuild-worker: add pulp configuration
Add support for pulp client configuration in the worker config.
Add test values to worker config test.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
ab659c013c upload/pulp: helper function to upload and distribute
Helper function that performs the whole upload and distribute procedure.
Two more helper functions are added for retrieving the href for a
repository based on its name, and for retrieving the base URL for a
repository's distribution.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
22e4169649 upload/pulp: task state functions
Define the task state enum based on the available values defined in the
API.

Add a helper function that returns true if a task is running or waiting
and ignores errors.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
50367e6f14 upload/pulp: distribute ostree repo
Function for distributing an ostree repository, making it available for
consumption.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
57f1bb8bf4 upload/pulp: import commit into repository
Function for importing a commit artifact (that's already been uploaded)
into a given repository.  Note that the "repo" argument to the
NewOstreeImportAll() function refers to the name of the repository
directory inside the archive, which for the commits we produce in
osbuild is always "repo".
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
4c002f3d54 upload/pulp: file upload method 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
1365347382 upload/pulp: list and create repositories 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
bc6c2fb6af upload: define new pulp uploader
Define a basic client struct to pull in the pulp-client library.
2023-10-18 21:14:46 +02:00