FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PDN Canto Config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Nairn
PDN Canto Config
Commits
f45ee45b
Commit
f45ee45b
authored
4 years ago
by
James Nairn
Browse files
Options
Downloads
Patches
Plain Diff
Added notes
parent
7c72839f
No related branches found
No related tags found
1 merge request
!6
Testing
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
jwrn3_test.sh
+0
-4
0 additions, 4 deletions
jwrn3_test.sh
notes.txt
+6
-9
6 additions, 9 deletions
notes.txt
starting-pack.sh
+2
-2
2 additions, 2 deletions
starting-pack.sh
test.sh
+0
-66
0 additions, 66 deletions
test.sh
weekly_routine.sh
+1
-1
1 addition, 1 deletion
weekly_routine.sh
with
9 additions
and
82 deletions
jwrn3_test.sh
deleted
100644 → 0
+
0
−
4
View file @
7c72839f
#!/bin/sh
# JWRN test script from within docker root
echo
"jwrn3_test"
>
./jwrn3_test_result
\ No newline at end of file
This diff is collapsed.
Click to expand it.
notes.txt
+
6
−
9
View file @
f45ee45b
...
...
@@ -2,16 +2,13 @@ Notes
canto-space = /data/export/canto/canto
OnCalendar=Mon 01:00:00
Systemd
Copy files to /etc/systemd/system/
sudo systemctl start canto_weekly.timer
Working
Is ssh passwordless set up for root? - No
Shuold weekly run as root or another user?
systemctl stop canto
Provide ssh ppublic key for fbadmin on deneb
Repository
https://gitlab.developers.cam.ac.uk/jwrn3/pdn-canto-config
https://gitlab.developers.cam.ac.uk/jwrn3/pdn-canto-config
\ No newline at end of file
# Rsync from repo to canto-space
rsync -av /data/export/canto-space/pdn-canto-config/ /data/export/canto-space/
This diff is collapsed.
Click to expand it.
starting-pack.sh
+
2
−
2
View file @
f45ee45b
...
...
@@ -17,7 +17,7 @@ cp canto-docker-initd /sbin/
chmod
a+x /sbin/canto-docker-initd
cp
canto-docker-initd ./canto/etc/
chmod
a+x ./canto/etc/canto-docker-initd
rm
canto-docker-initd
#
rm canto-docker-initd
##create a 'canto' file @ /etc/init.d
##and make it executable
...
...
@@ -45,6 +45,6 @@ done
#run the weekly routine script which executes all configuration steps
sh weekly_routine.sh
#
sh weekly_routine.sh
This diff is collapsed.
Click to expand it.
test.sh
deleted
100755 → 0
+
0
−
66
View file @
7c72839f
#!/bin/sh
# Called if total failure happens
function
fail
{
# Echo output to stderr
echo
"
${
1
}
"
>
&2
# Exit with non-zero code
exit
1
}
function
retry
{
# Define local vars
# Starting number
local
n
=
1
# Max number of attempts
local
max
=
5
# Sleep period in seconds until retry
local
delay
=
2
# Loop
while
true
;
do
# Run array of commands passed in and break loop if successful
"
${
@
}
"
&&
break
||
{
# Else loop while attempt no is less than max
if
[[
"
${
n
}
"
-lt
"
${
max
}
"
]]
;
then
# Increment attempt counter
((
n++
))
# echo status
echo
"Command failed. Attempt
${
n
}
/
${
max
}
"
# Sleep for period
sleep
${
delay
}
else
# Hit max attempts and still failed so giving up
fail
"The command has failed after
${
n
}
attempts."
fi
}
done
}
# Grab file from Daneb
FILENAME
=
"marker_file.txt"
retry scp jwrn3@ent.csi.cam.ac.uk:
"
${
FILENAME
}
"
/tmp/
# Get DBNAME from downloaded file
if
[[
-e
"/tmp/
${
FILENAME
}
"
]]
;
then
DBNAME
=
$(
cat
"/tmp/
${
FILENAME
}
"
)
fi
# Check DBNAME is not blank
if
[[
-z
${
BDNAME
}
]]
;
then
echo
"
${
DBNAME
}
is blank, cannot continue"
exit
1
fi
# Transform $DBNAME
sed
-E
"s/(^[[:space:]]+
\-
[[:space:]]
\"
dbi
\:
Pg
\:
dbname=)[[:alpha:]]+(
\;
[[:space:]]host=deneb
\.
pdn
\.
cam
\.
ac
\.
uk
\"
)/
\1
${
DBNAME
}
\2
/"
canto_deployment.yaml
\ No newline at end of file
This diff is collapsed.
Click to expand it.
weekly_routine.sh
+
1
−
1
View file @
f45ee45b
...
...
@@ -144,7 +144,7 @@ if [[ -z ${BDNAME } ]]; then
fi
# Transform $DBNAME
CANTO_CONFIG
=
"./canto_deploy.yaml"
CANTO_CONFIG
=
".
canto
/canto_deploy.yaml"
if
[[
-e
"
${
CANTO_CONFIG
}
"
]]
;
then
sed
-i
.bak
-E
"s/(^[[:space:]]+
\-
[[:space:]]
\"
dbi
\:
Pg
\:
dbname=)[[:alpha:]]+(
\;
[[:space:]]host=deneb
\.
pdn
\.
cam
\.
ac
\.
uk
\"
)/
\1
${
DBNAME
}
\2
/"
"
${
CANTO_CONFIG
}
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment