Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Merge requests
!33
Resolve
L2SS-218
"Move existing tooling to bootstrap dir"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve
L2SS-218
"Move existing tooling to bootstrap dir"
L2SS-218-move_existing_tooling_to_bootstrap_dir
into
master
Overview
12
Commits
14
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Merged
Thomas Juerges
requested to merge
L2SS-218-move_existing_tooling_to_bootstrap_dir
into
master
3 years ago
Overview
12
Commits
14
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Expand
This is the beginning.
Closes
L2SS-218
0
0
Merge request reports
Viewing commit
687be444
Prev
Next
Show latest version
1 file
+
1
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
687be444
L2SS-218
Run make minimal and not make start minimal
· 687be444
Thomas Juerges
authored
3 years ago
bootstrap/sbin/rebuild_system_from_scratch.sh
0 → 100755
+
152
−
0
Options
#! /usr/bin/env bash -e
HOME_DIR
=
${
LOFAR20_DIR
:-${
PWD
}}
if
[
!
-d
${
HOME_DIR
}
/bootstrap
]
;
then
# HOME_DIR/bootstrap needs to exist for this script to work.
echo
-e
"
$(
basename
${
0
}
)
:
\n\n
ERROR
\n\t
Cannot run this script because the
\"
bootstrap
\"
cannot be found!
\n\n
"
exit
1
fi
# Save for the moment when tango will be cloned.
OLD_HOME_DIR
=
${
HOME_DIR
}
.old
trap
' exit ${?} '
ABRT EXIT HUP INT TERM QUIT ERR
function
pull_images
()
{
(
cd
${
HOME_DIR
}
/docker-compose
&&
make pull
)
}
function
build_lofar_images
()
{
(
cd
${
HOME_DIR
}
/docker-compose
&&
make build
)
}
function
move_tango_dir_out_of_the_way
()
{
mv
${
HOME_DIR
}
${
OLD_HOME_DIR
}
}
function
remove_images
()
{
${
HOME_DIR
}
/bootstrap/sbin/delete_all_docker_images.sh YES_DELETE_ALL
}
function
pull_tango
()
{
git clone https://git.astron.nl/lofar2.0/tango.git
${
HOME_DIR
}
# Now remove the old tango dir.
rm
-rf
${
OLD_HOME_DIR
}
}
function
clean_images
()
{
# This can return a non-0 return code if the system
# has already been shut down.
# Therefore disable Bash's exit on error flag
set
+e
(
cd
${
HOME_DIR
}
/docker-compose
&&
make clean
)
# And enable it again.
set
-e
}
function
start_minimal_tango
()
{
(
cd
${
HOME_DIR
}
/docker-compose
make minimal
# There is an issue with the dsconfig container that it every
# other time just exits without telling why.
# Therefore start dsconfig, then wait for 10s to allow it
# to die and just start it again.
# Don't they say that the second time is always a charm?
make start dsconfig
echo
-e
"
\t
Waiting for dsconfig to settle down..."
sleep
10
echo
-e
"
\t
Done.
\n\t
Starting dsconfig again."
make start dsconfig
)
}
function
configure_tango_db
()
{
# This somehow returns with a non-0 return code, make Bash happy.
${
HOME_DIR
}
/sbin/update_ConfigDb.sh
${
HOME_DIR
}
/CDB/LOFAR_ConfigDb.json
||
true
}
function
configure_elk
()
{
(
cd
${
HOME_DIR
}
/docker-compose
&&
make start elk-configure-host
)
}
function
start_support_images
()
{
(
cd
${
HOME_DIR
}
/docker-compose
&&
make start elk
make start jupyter
)
}
function
start_lofar_images
()
{
(
cd
${
HOME_DIR
}
/docker-compose
make start device-pcc
make start device-sdp
)
}
# Clean out the Docker volumes.
echo
"-> Stopping Docker images and cleaning cleaning up their volumes..."
clean_images
echo
-e
"
\t
Done.
\n
"
# Move the tango repo dir out of the way.
echo
"-> Moving the tango directory
${
HOME_DIR
}
out of the way..."
move_tango_dir_out_of_the_way
echo
-e
"
\t
Done.
\n
"
# Now pull the repo.
echo
"-> Cloning tango's master branch to
${
HOME_DIR
}
..."
pull_tango
echo
-e
"
\t
Done.
\n
"
# Now clean out the docker images.
echo
"-> Deleting all Docker images from this host..."
remove_images
echo
-e
"
\t
Done.
\n
"
# Pull SKA's Docker images.
echo
"-> Installing latest SKA Docker images on this host..."
pull_images
echo
-e
"
\t
Done.
\n
"
# Build all of the LOFAR Docker images.
echo
"-> Building LOFAR2.0 Docker images..."
build_lofar_images
echo
-e
"
\t
Done.
\n
"
# Now start the basic Tango system, including dsconfig.
echo
"-> Staring up a minimal Tango session..."
start_minimal_tango
echo
-e
"
\t
Done.
\n
"
# Load LOFAR's TangoDB.
echo
"-> Configuring the Tango DB for LOFAR2.0..."
configure_tango_db
echo
-e
"
\t
Done.
\n
"
# Now configure the ELK container.
echo
"-> Configuring the ELK container for this host..."
configure_elk
echo
-e
"
\t
Done.
\n
"
# Here I start ELK & Jupyter.
echo
"-> Start LOFAR2.0 support containers (ELK, Jupyter, etc.)..."
start_support_images
echo
-e
"
\t
Done.
\n
"
# And finally start all the LOFAR images.
echo
"-> Start LOFAR2.0 containers..."
start_lofar_images
echo
-e
"
\t
Done.
\n
"
# Now the system should be ready to use.
# For instance the cold start script could now be executed.
echo
-e
"-> LOFAR2.0 system rebuild was successful.
\n\n
"
Loading