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

(Archiving) Use tag when fetching spring files #2730

Merged
merged 12 commits into from
Dec 5, 2023

Conversation

islean
Copy link
Contributor

@islean islean commented Dec 1, 2023

Description

Closes #2729. The intent is to speed up the archive CLI commands by filtering the spring files we fetch with the newly added archive location tag.

Changed

  • Files to archive are now filtered already in the SQL query, using the archive location tag.

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_cg -t cg -b archiving-use-location-tag -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

  • Tests executed by
  • "Merge and deploy" approved by
    Thanks for filling in who performed the code review and the test!

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@islean islean self-assigned this Dec 1, 2023
@islean
Copy link
Contributor Author

islean commented Dec 4, 2023

Archiving three files using the tag reduced the run time from 20 minutes to 30 seconds:

θ63° 1d [isak.ohlsson@hasta:~] [S_base] 3m50s $ cg archive archive-spring-files
/home/proj/stage/bin/miniconda3/envs/S_cg/lib/python3.11/site-packages/urllib3/connectionpool.py:1095: InsecureRequestWarning: Unverified HTTPS request is being made to host 'cg-df-cat.scilifelab.se'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
Sending request with headers: 
{'Content-Type': 'application/json', 'accept': 'application/json', 'Authorization': 'Bearer ****'} 
and body: 
{'osType': 'Unix/MacOS', 'createFolder': True, 'settings': [], 'pathInfo': [{'destination': 'archive@SciLifeLab:/stage/isaks_test_bundle', 'source': 'gpfs@Hasta:/proj/stage/housekeeper-bundles/isaks_test_bundle/2023-11-30/isaks_test_spring_file.spring'}], 'metadataList': []}
/home/proj/stage/bin/miniconda3/envs/S_cg/lib/python3.11/site-packages/urllib3/connectionpool.py:1095: InsecureRequestWarning: Unverified HTTPS request is being made to host 'cg-df-cat.scilifelab.se'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
Files submitted to karolinska_bucket with archival task id 132.
Adding an archive to file 5002316 with archiving task id 132
θ62° 1d [isak.ohlsson@hasta:~] [S_base] 28s $ 

@islean
Copy link
Contributor Author

islean commented Dec 4, 2023

Updating job statuses ran for 27 seconds as well:

θ60° 1d [isak.ohlsson@hasta:~] [S_base] 24s 2 $ cg archive update-job-statuses
/home/proj/stage/bin/miniconda3/envs/S_cg/lib/python3.11/site-packages/urllib3/connectionpool.py:1095: InsecureRequestWarning: Unverified HTTPS request is being made to host 'cg-df-cat.scilifelab.se'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
Fetching status for job with id 132 from karolinska_bucket
Sending request with headers: 
{'Content-Type': 'application/json', 'accept': 'application/json', 'Authorization': 'Bearer ****'} 
and body: 
{'id': 132}
/home/proj/stage/bin/miniconda3/envs/S_cg/lib/python3.11/site-packages/urllib3/connectionpool.py:1095: InsecureRequestWarning: Unverified HTTPS request is being made to host 'cg-df-cat.scilifelab.se'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
Miria returned status Completed for job 132
Job with id 132 has finished, updating Archive entries.
θ60° 1d [isak.ohlsson@hasta:~] [S_base] 27s $ 

@islean islean marked this pull request as ready for review December 4, 2023 14:38
@islean islean requested a review from a team as a code owner December 4, 2023 14:38
cg/meta/archive/archive.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ChrOertlin ChrOertlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

cg/apps/housekeeper/hk.py Show resolved Hide resolved
cg/apps/housekeeper/hk.py Show resolved Hide resolved
cg/meta/archive/archive.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Vince-janv Vince-janv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution 👍

cg/meta/archive/archive.py Outdated Show resolved Hide resolved
cg/meta/archive/archive.py Outdated Show resolved Hide resolved
cg/meta/archive/archive.py Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@islean islean merged commit 50f1624 into master Dec 5, 2023
9 checks passed
@islean islean deleted the archiving-use-location-tag branch December 5, 2023 13:58
@islean
Copy link
Contributor Author

islean commented Dec 5, 2023

Deployed to production:

Log deploy... done.
cg, version 53.4.3

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.

(Archiving) Use archive location tag to filter files to archive
3 participants