ualbertalib / pushmi_pullyu

Ruby application to manage flow of content from Fedora into Swift for preservation
MIT License
1 stars 3 forks source link

Investigate using pushmi_pullyu with OLRC #349

Open pgwillia opened 1 year ago

pgwillia commented 1 year ago

Investigate using pushmi_pullyu with OLRC

I think we will likely need to re-configure PMPY to point to OLRC this fall. With that we might take several approaches - simple configuration of existing PMPY against a new swift container using the current API approach, or a more complex project of integrating Duracloud into our PMPY pipeline. - Kenton

First steps

  1. Meet with Kenton for context and make this a ticket.
  2. Ask for credentials that we'll need and the container we'll write to for this test.

Maybe the first step is seeing if our development environment will write to OLRC.

jefferya commented 1 year ago

Here are the major differences I've experienced when converting the CWRC perseveration tooling to use OLRC Swift as a drop-in replacement for UAL Swift.

The main difference, OLRC requires an additional property, a domain as part of the authentication. As of 2023-08-15, I'm testing to see if further changes are required: https://github.com/ualbertalib/cwrc_preservation/tree/jefferya/olrc_compatibility

The ruby-openstack connection is defined here: https://github.com/ruby-openstack/ruby-openstack/blob/master/lib/openstack/connection.rb

The aforementioned OpenStack RC file can be downloaded from the Horizon UI via the upper right-hand corner user account menu.

If you want to test the Swift authentication, one can use the OpenStack Swift command-line tool. The following is a command-line OpenStack Swift example that can be used to test (replace values with items from the OpenStack RC file) the individual parameters.

swift --os-auth-url 'a' \
  --os-username 'b' \
  --os-user-domain-name 'c' \
  --os-password  'd' \
  --os-project-name 'e' \
  --os-project-domain-id 'f' \
  --auth-version 3 \
  stat

Note: running source on the OpenStack RC file will populate environment variables so one doesn't need to populate the swift command-line arguments as on the command line (e.g., don't need to add a visible password on the command-line).

The install process for the Swift client is:

pip3 install python-swiftclient --user

One might also need sudo apt install python-openstackclient but I'm not certain.

lagoan commented 1 year ago

Thanks to @jefferya work the process of redirecting PMPY to OLRC has been straightforward.

The following shell command works for me to test authentication:

swift --os-auth-url 'AUTH_URL' \
      --os-username 'USER_NAME' \
      --os-user-domain-name 'USER_DOMAIN_NAME' \
      --os-password  'PASSWORD' \
      --os-project-name 'PROJECT_NAME' \
      --os-project-domain-name 'PROJECT_DOMAIN_NAME' \
      --auth-version 3 \
      stat

The changes in the codebase to redirect pushing the items to OLRC Swift have been mirroring the configuration changes used to authenticate.

I've successfully pushed synthetic data to a new container in OLRC.

My next steps include: