-
Notifications
You must be signed in to change notification settings - Fork 15
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
Make alt efs sync with live #2025
Draft
kencho51
wants to merge
34
commits into
gigascience:develop
Choose a base branch
from
kencho51:make-alt-efs-sync-with-live
base: develop
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.
Draft
Make alt efs sync with live #2025
kencho51
wants to merge
34
commits into
gigascience:develop
from
kencho51:make-alt-efs-sync-with-live
Conversation
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 was referenced Sep 10, 2024
kencho51
force-pushed
the
make-alt-efs-sync-with-live
branch
from
September 19, 2024 01:42
1adfa18
to
b189e39
Compare
kencho51
force-pushed
the
make-alt-efs-sync-with-live
branch
2 times, most recently
from
September 27, 2024 03:01
184014b
to
62391b5
Compare
kencho51
force-pushed
the
make-alt-efs-sync-with-live
branch
from
October 23, 2024 04:39
a07939a
to
6d6ddaf
Compare
This reverts commit 6fd9005.
kencho51
force-pushed
the
make-alt-efs-sync-with-live
branch
from
October 24, 2024 05:15
68ef8e1
to
b208b5d
Compare
kencho51
force-pushed
the
make-alt-efs-sync-with-live
branch
from
October 24, 2024 05:59
400783b
to
7ca6611
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request for issue: #2000
This is a pull request for the following functionalities:
How to test?
Describe how the new functionalities can be tested by PR reviewers
In local dev
Pre-requisites
In staging as a centos user
In staging as a lily user
In live as a centos user
In live as a lily user
How have functionalities been implemented?
Describe how the new functionalities have been implemented by the
changed code at a high level
The script
sync_dropbox
uses rclone sync to make sure the efs mount point/share/dropbox
in alt upstream always stays as the same as the one found in the upstream. Rclone sync will only the source to the destination, changing the destination only.The pre-defined rclone config for the sync is located at
gigadb/app/tools/sync-dropbox/config/rclone.conf
in the local dev encironment, and at/etc/sync_dropbox/rclone.conf
in the production environments, which specifies the endpoints for production staging efs and the production live efs.To access these endpoints through a secure connection, a ssh private key
id-rsa-aws-hk-gigadb.pem
needs to be pulled from the gitlab cnhk-infra variable page to the~/.ssh/
directory, this private key is supposedly for thegigadb
user to provision the upstream ec2 servers. By sharing this key, the efs in the upstream can be accessed from the alt upstream securely, otherwise the users in the alt upstream needs to copy the public key to the upstream server using this keyid-rsa-aws-hk-gigadb.pem
if they want to use their own ssh key pairs, which seems adding an extra layer of complication.In order to get rid of the
Permission denied
error when the/usr/local/bin/sync_dropbox
trying to output log in production environments, agigadb
group is created and make the/var/log/gigadb
directory ber+w
to thegigadb
group, then add centos and other users, eg. lily togigadb
group, as a result,/var/log/gigadb
can ber+w
by both centos and other users.Any issues with implementation?
None
Any changes to automated tests?
None
Any changes to documentation?
None
Any technical debt repayment?
logrotate
has been implemented in this PR, the main config for the logrotate is at/etc/logrorate.d/gigadb
,which indicates every log inside
/var/log/gigadb
will be rotated daily 7 times, each rotated log will be compressed withYYYYMMDD
in the file name suffix, as you can see below:The
logrotate
requires the log directory and the log file to have a secure permission, so, the log can be read and written byroot
user and any user in the groupgigadb
.For the purpose of testing, after logging into your staging, you can force rotate the log to check if it works correctly:
Additionally, I have made my staging bastion running the script for more that 7 days to test for cron job and also the logrotation, here is the results:
As a result, it is suggested the all the script outputs should be stored in the
/var/log/gigadb
, so the log files will be better managed automatically.Any improvements to CI/CD pipeline?
None