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
Commits
617050bb
Commit
617050bb
authored
4 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-218
Refined the clean-up script
parent
88538150
No related branches found
No related tags found
1 merge request
!33
Resolve L2SS-218 "Move existing tooling to bootstrap dir"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bootstrap/sbin/rebuild_system_from_scratch.sh
+52
-19
52 additions, 19 deletions
bootstrap/sbin/rebuild_system_from_scratch.sh
with
52 additions
and
19 deletions
bootstrap/sbin/rebuild_system_from_scratch.sh
+
52
−
19
View file @
617050bb
#! /usr/bin/env bash -e
#! /usr/bin/env bash -e
HOME_DIR
=
/opt/lofar2.0
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
trap
' exit ${?} '
ABRT EXIT HUP INT TERM QUIT ERR
trap
' popd; exit ${?} '
ABRT EXIT HUP INT TERM QUIT ERR
function
pull_images
()
function
pull_images
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
&&
make pull
pushd
${
HOME_DIR
}
/docker-compose
&&
make pull
popd
popd
}
}
function
build_lofar_images
()
function
build_lofar_images
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
&&
make build
pushd
${
HOME_DIR
}
/docker-compose
&&
make build
popd
popd
}
}
function
remove_tango_dir
()
function
remove_tango_dir
()
{
{
pushd
${
HOME_DIR
}
&&
rm
-rf
tango
rm
-rf
${
HOME_DIR
}
popd
}
}
function
remove_images
()
function
remove_images
()
{
{
${
HOME_DIR
}
/delete_all_docker_images.sh YES_DELETE_ALL
${
HOME_DIR
}
/
bootstrap/sbin/
delete_all_docker_images.sh YES_DELETE_ALL
}
}
function
pull_tango
()
function
pull_tango
()
{
{
git clone https://git.astron.nl/lofar2.0/tango.git
${
HOME_DIR
}
/tango
git clone https://git.astron.nl/lofar2.0/tango.git
${
HOME_DIR
}
}
}
function
stop_images
()
function
stop_images
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
&&
make stop
pushd
${
HOME_DIR
}
/docker-compose
&&
make stop
popd
popd
}
}
function
clean_images
()
function
clean_images
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
&&
make clean
pushd
${
HOME_DIR
}
/docker-compose
&&
make clean
popd
popd
}
}
function
start_tango
()
function
start_
minimal_
tango
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
pushd
${
HOME_DIR
}
/docker-compose
make start
itango
make start
minimal
make start dsconfig
make start dsconfig
popd
popd
}
}
function
configure_tango_db
()
function
configure_tango_db
()
{
{
${
HOME_DIR
}
/
tango/
sbin/update_ConfigDb.sh
${
HOME_DIR
}
/
tango/
CDB/LOFAR_ConfigDb.json
${
HOME_DIR
}
/sbin/update_ConfigDb.sh
${
HOME_DIR
}
/CDB/LOFAR_ConfigDb.json
}
}
function
configure_elk
()
function
configure_elk
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
&&
make start elk-configure-host
pushd
${
HOME_DIR
}
/docker-compose
&&
make start elk-configure-host
popd
popd
}
}
function
start_support_images
()
function
start_support_images
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
&&
make start elk
pushd
${
HOME_DIR
}
/docker-compose
&&
make start elk
make start jupyter
make start jupyter
popd
popd
}
}
function
start_lofar_images
()
function
start_lofar_images
()
{
{
pushd
${
HOME_DIR
}
/
tango/
docker-compose
pushd
${
HOME_DIR
}
/docker-compose
make start device-pcc
make start device-pcc
make start device-sdp
make start device-sdp
popd
popd
}
}
# Stop all Docker images.
stop_images
stop_images
# Clean out the Docker volumes.
clean_images
clean_images
# Delete the tango repo dir. Notice that this also deletes the bootstrap dir
# which contains this and the helper scripts.
remove_tango_dir
remove_tango_dir
remove_images
# Therefore, since the tango/boostrap dir is now gone, pull the repo first
# and then continue.
pull_tango
pull_tango
# Now clean out the docker images.
remove_images
# Pull SKA's Docker images.
pull_images
pull_images
# Build all of the LOFAR Docker images.
build_lofar_images
build_lofar_images
start_tango
# Now start the basic Tango system, including dsconfig.
start_minimal_tango
# Load LOFAR's TangoDB.
configure_tango_db
configure_tango_db
# Now configure the ELK container.
configure_elk
configure_elk
# Here I start ELK & Jupyter.
start_support_images
start_support_images
# And finally start all the LOFAR images.
start_lofar_images
start_lofar_images
# Now the system should be ready to use.
# For instance the cold start script could now be executed.
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