Skip to content

Commit

Permalink
add a systemd service to launch giskard at boot on AWS machines
Browse files Browse the repository at this point in the history
  • Loading branch information
reneab committed Jul 19, 2022
1 parent 3305af9 commit 68316ca
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/infrastructure/giskard-docker-start.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# this is a systemd service, to be put in /usr/lib/systemd/system
# and enabled with 'sudo systemctl enable giskard-docker-start-service'
[Unit]
Description=Docker Compose Giskard starter
After=docker.service network-online.target
Requires=docker.service network-online.target

[Service]
WorkingDirectory=/home/ec2-user
Type=oneshot
RemainAfterExit=yes

# change this to branch main before merging
ExecStartPre=-/bin/bash -c "/bin/curl -f 'https://raw.githubusercontent.com/Giskard-AI/giskard/feat/ami/docker-compose.ami.yml' -o docker-compose.ami.yml"
ExecStartPre=-/bin/bash -c "/bin/curl -f 'https://raw.githubusercontent.com/Giskard-AI/giskard/main/docker-compose.yml' -o docker-compose.yml"
ExecStartPre=-/usr/local/bin/docker-compose pull --quiet
ExecStart=/usr/local/bin/docker-compose -f docker-compose.yml -f docker-compose.ami.yml up -d

ExecStartPost=/bin/bash -c "echo 'Pruning docker images...'"
ExecStartPost=-docker image prune -f

ExecStop=/usr/local/bin/docker-compose down

[Install]
WantedBy=multi-user.target

0 comments on commit 68316ca

Please sign in to comment.