-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add rucio upload script and rucio configuration file #27
Open
rahmans1
wants to merge
20
commits into
main
Choose a base branch
from
feature-register-to-rucio
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
604e463
Add rucio registration code snippet to run script
rahmans1 744f509
Move rucio registration to separate script
rahmans1 98c8676
Remove heredoc.
rahmans1 d25b1e4
Removing the rucio related variables from here
rahmans1 d5bb403
Introduce argument parser and a few cosmetic changes
rahmans1 903a47e
Register full and reco files to rucio if they are written
rahmans1 5f9e579
Initialize rucio client
rahmans1 a5371da
Revert "Register full and reco files to rucio if they are written"
38a64d5
Add rucio configuration file
3a0fe12
Update register_to_rucio.py
rahmans1 29112ef
Add test to check standalone rucio upload script
rahmans1 55e1d8c
Environment variable for proxy
rahmans1 aa8696b
Dictionary uses : and not =
rahmans1 8772090
Set the environment variable to proxy path separately
rahmans1 5df3029
Use quotes around environment variable
rahmans1 97ea4e0
Remove rucio test from production test workflow
rahmans1 e662b1b
Separate workflow to test rucio upload
rahmans1 714e7e0
Temporarily run with PR synchronization
rahmans1 550a6e9
Don't run with every PR sync
rahmans1 5c2d62a
Change job name
rahmans1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test upload to rucio | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 1,15 * *' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
rucio-upload: | ||
# Note: this workflow must run on linux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cvmfs-contrib/github-action-cvmfs@v3 | ||
- uses: eic/run-cvmfs-osg-eic-shell@main | ||
env: | ||
X509_PROXY: ${{ secrets.X509_PROXY }} | ||
with: | ||
platform-release: "jug_xl:nightly" | ||
run: | | ||
# Generate a timestamp | ||
timestamp=$(date '+%Y-%m-%d_%H-%M-%S') | ||
eic-info > eic-info_${timestamp}.txt | ||
echo "${X509_PROXY}" > x509_user_proxy | ||
|
||
# Test rucio upload script | ||
export X509_USER_PROXY=x509_user_proxy | ||
RUCIO_CONFIG=scripts/rucio.cfg python scripts/register_to_rucio.py -f "eic-info_${timestamp}.txt" -d "/main/CI/Rucio/eic-info_${timestamp}.txt" -s epic | ||
|
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,29 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import os | ||
from rucio.client.uploadclient import UploadClient | ||
|
||
parser = argparse.ArgumentParser(prog='Register to RUCIO', description='Registers files to RUCIO') | ||
parser.add_argument("-f", dest="file_path", action="store", required=True, help="Enter the local file path") | ||
parser.add_argument("-d", dest="did_name", action="store", required=True, help="Enter the data identifier for rucio catalogue") | ||
parser.add_argument("-s", dest="scope", action="store", required=True, help="Enter the scope") | ||
args=parser.parse_args() | ||
|
||
file_path = args.file_path | ||
did_name = args.did_name | ||
parent_directory = os.path.dirname(did_name) | ||
scope= args.scope | ||
rse="EIC-XRD" | ||
|
||
uploads_items = [{ | ||
'path': file_path, | ||
'rse': rse, | ||
'did_scope': scope, | ||
'did_name': did_name, | ||
'dataset_scope': scope, | ||
'dataset_name': parent_directory | ||
}] | ||
|
||
upload_client = UploadClient() | ||
upload_client.upload(uploads_items) |
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,6 @@ | ||
[client] | ||
rucio_host = https://rucio-server.jlab.org:443 | ||
auth_host = https://rucio-server.jlab.org:443 | ||
auth_type = x509_proxy | ||
client_x509_proxy = $X509_USER_PROXY | ||
account = eicprod |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work when specified as an environment variable?