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

Merge feature branch feature/easier-pool-join #6305

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

gangj
Copy link
Contributor

@gangj gangj commented Feb 14, 2025

No description provided.

gangj and others added 28 commits October 23, 2024 10:18
…xapi-project#6049)

- add a new type of origin: "remote_pool"
- add a new API: "introduce_remote_pool" to init a remote_pool repository
- add a new field: "certificate" for a remote_pool repository
- for a remote_pool repository, binary_url will be reused to hold the
  base URL of binary packages in the local repository of the remote pool in
  https://<coordinator-ip>/repository format

Signed-off-by: Gang Ji <[email protected]>
The HTTP /repository handler is guarded by a mutex `exposing_pool_repo_mutex` currently.
Since now HTTP /repository is protected by `session_id` cookie, we can remove the mutex
from this handler and keep the handler enabled all the time.
Also, rename the mutex `exposing_pool_repo_mutex` to `pool_update_ops_mutex`.

Signed-off-by: Bengang Yuan <[email protected]>
The HTTP /repository handler is guarded by a mutex
`exposing_pool_repo_mutex` currently. Since now HTTP /repository is
protected by `session_id` cookie, we can remove the mutex and keep the
handler enabled all the time. Also, rename the mutex
`exposing_pool_repo_mutex` to `pool_update_ops_mutex`.
merge master to feature/easier-pool-join
Now xapi supports setting up rpc to hosts in the pool and appliances,
while for syncing updates from remote_pool type repository, we need to
set up rpc to remote coordinator with its certificate verfieid.

Add util Helpers.make_external_host_verified_rpc, which will set up a
secure connection to the external host(host outside the pool) with its
host certificate verified.

Signed-off-by: Gang Ji <[email protected]>
Now xapi supports setting up rpc to hosts in the pool and appliances,
while for syncing updates from remote_pool type repository, we need to
set up rpc to remote coordinator with its certificate verfieid.

Add util Helpers.make_external_host_verified_rpc, which will set up a
secure connection to the external host(host outside the pool) with its
host certificate verified.
Add an assertion to restrict `binary_url` of remote_pool repository to be in the
format of `https://<coordinator-ip>/repository/enabled`.

Signed-off-by: Bengang Yuan <[email protected]>
…roject#6089)

1. Add an assertion to restrict `binary_url` of remote_pool repository
to be in the format of `https://<coordinator-ip>/repository/enabled`.
2. Add UT for restrict/check `binary_url` of remote_pool repository.
Add handler for `/repository/enabled`. Replase `/enabled` with
the current enabled repository.

Signed-off-by: Bengang Yuan <[email protected]>
Adding process logic for `/repository/enabled`. If there is `/enabled`
after `/repository` in URI, then to find the current enabled repository.
Otherwise, keep the existing process logic.
1. `remote_pool` repo doesn't support periodic sync updates.
2. Periodic sync updates should be auto-disabled when calling `set_repositories`
   and `add_repository` for `remote_pool` repo.
3. If `remote_pool` repository is enabled, it should be the single one
   enabled.

Signed-off-by: Bengang Yuan <[email protected]>
)

1. `remote_pool` repo doesn't support periodic sync updates.
2. Periodic sync updates should be auto-disabled when calling
`set_repositories` and `add_repository` for `remote_pool` repo.
4. Update UT.
When a remote_pool type repository, which points to the enabled
repository in the remote pool coordinator, is set as the enabled
repository of the pool, updates can be synced from it with API
pool.sync_updates.

The username password of the remote pool coordinator is required as
parameters for pool.sync_updates to login the remote pool.

And the remote pool coordinator's host server certificate needs to be
configured in the remote_pool repository, it will be used to verify the
remote end when sending out username passwords and syncing updates from
it.

A new yum/dnf plugin "xapitoken" is introduced to set xapi token as HTTP
cookie: "session_id" for each HTTP request which downloads files from the
remote_pool repository.

Signed-off-by: Gang Ji <[email protected]>
Will re-enable repo_gpgcheck by reverting this commit after CP-51429 is done.

Signed-off-by: Gang Ji <[email protected]>
CP-50787 CP-51347: Support pool.sync_updates from remote_pool repo

When a remote_pool type repository, which points to the enabled
repository in the remote pool coordinator, is set as the enabled
repository of the pool, updates can be synced from it with API
pool.sync_updates.

The username password of the remote pool coordinator is required as
parameters for pool.sync_updates to login the remote pool.

And the remote pool coordinator's host server certificate needs to be
configured in the remote_pool repository, it will be used to verify the
remote end when sending out username passwords and syncing updates from
it.

A new yum/dnf plugin "xapitoken" is introduced to set xapi token as HTTP
cookie: "session_id" for each HTTP request which downloads files from the
remote_pool repository.


CP-52245: Temp disable repo_gpgcheck when syncing from remote_pool repo

Will re-enable repo_gpgcheck by reverting this commit after CP-51429 is done.
Solve conflict:
Stunnel.with_client_proxy -> Stunnel.with_client_proxy_systemd_service
Solve conflict:
Stunnel.with_client_proxy -> Stunnel.with_client_proxy_systemd_service
When enabling pool's repositories, if enabling bundle repo and remoe_pool
repositories at the same time, it returns error message:
`If the bundle repository or remote_pool repository is enabled, it should be
the only one enabled repository of the pool.
repo_types: bundle`
The `repo_types` is confusing and tedious as only these 2 types of repository
can meet this error. So remove the parameter `repo_types`.

Signed-off-by: Bengang Yuan <[email protected]>
When enabling pool's repositories, if enabling bundle repo and
remoe_pool
repositories at the same time, it returns error message:
`If the bundle repository or remote_pool repository is enabled, it
should be
the only one enabled repository of the pool.
repo_types: bundle`
The `repo_types` is confusing and tedious as only these 2 types of
repository
can meet this error. So remove the parameter `repo_types`.
@gangj gangj force-pushed the private/gangj/easier-pool-join_master-merge branch from 803839f to 1d5cc18 Compare February 14, 2025 11:03
@gangj
Copy link
Contributor Author

gangj commented Feb 14, 2025

$ git show 1d5cc1876d6
commit 1d5cc1876d65b114444a26388d68e74199d61476 (HEAD -> private/gangj/easier-pool-join_master-merge, my_gh/private/gangj/easier-pool-join_master-merge)
Merge: f4f00b3971 753a667332
Author: Gang Ji <[email protected]>
Date:   Fri Feb 14 18:52:58 2025 +0800

    Merge branch 'feature/easier-pool-join' into master

    Signed-off-by: Gang Ji <[email protected]>

diff --cc ocaml/idl/schematest.ml
index dcb0722a8c,8f87550cc0..d17b6cf488
--- a/ocaml/idl/schematest.ml
+++ b/ocaml/idl/schematest.ml
@@@ -3,7 -3,7 +3,7 @@@ let hash x = Digest.string x |> Digest.
  (* BEWARE: if this changes, check that schema has been bumped accordingly in
     ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *)

- let last_known_schema_hash = "6f6230f87a92572b68ebd742196ffd0e"
 -let last_known_schema_hash = "ffceac5e586329de3267b9bb958524a7"
++let last_known_schema_hash = "05ac9223f9c17b07b12e328d5dc3db52"

  let current_schema_hash : string =
    let open Datamodel_types in

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