diff --git a/.github/workflows/deploy.sh b/.github/workflows/deploy.sh index 720744a5..667a09b4 100755 --- a/.github/workflows/deploy.sh +++ b/.github/workflows/deploy.sh @@ -25,7 +25,7 @@ else if [ "$SP_MINI_SIZE" == "large" ] then - # prepare env vars for docker-compose + # prepare env vars for docker compose echo -n > provisioning/roles/docker/files/.env echo "ELASTICSEARCH_MEM_SIZE=2560m" >> provisioning/roles/docker/files/.env echo "ELASTICSEARCH_HEAP_SIZE=1280m" >> provisioning/roles/docker/files/.env @@ -47,7 +47,7 @@ else fi elif [ "$SP_MINI_SIZE" == "xlarge" ] then - # prepare env vars for docker-compose + # prepare env vars for docker compose echo -n > provisioning/roles/docker/files/.env echo "ELASTICSEARCH_MEM_SIZE=5g" >> provisioning/roles/docker/files/.env echo "ELASTICSEARCH_HEAP_SIZE=2560m" >> provisioning/roles/docker/files/.env @@ -69,7 +69,7 @@ else fi elif [ "$SP_MINI_SIZE" == "xxlarge" ] then - # prepare env vars for docker-compose + # prepare env vars for docker compose echo -n > provisioning/roles/docker/files/.env echo "ELASTICSEARCH_MEM_SIZE=10g" >> provisioning/roles/docker/files/.env echo "ELASTICSEARCH_HEAP_SIZE=5g" >> provisioning/roles/docker/files/.env diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 75f9bf8b..5530ed1c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,13 +22,13 @@ jobs: cd $GITHUB_WORKSPACE/provisioning/resources/control-plane go test *.go - - name: Setup upterm session - uses: lhotari/action-upterm@v1 - with: - ## limits ssh access and adds the ssh public key for the user which triggered the workflow - limit-access-to-actor: true - ## limits ssh access and adds the ssh public keys of the listed GitHub users - limit-access-to-users: benjben + #- name: Setup upterm session + # uses: lhotari/action-upterm@v1 + # with: + # ## limits ssh access and adds the ssh public key for the user which triggered the workflow + # limit-access-to-actor: true + # ## limits ssh access and adds the ssh public keys of the listed GitHub users + # limit-access-to-users: benjben - name: Provision a local Mini instance run: ansible-playbook -i $GITHUB_WORKSPACE/provisioning/inventory $GITHUB_WORKSPACE/provisioning/local_setup.yml --connection=local --become diff --git a/provisioning/resources/control-plane/restart_services.go b/provisioning/resources/control-plane/restart_services.go index 573808d0..46833925 100644 --- a/provisioning/resources/control-plane/restart_services.go +++ b/provisioning/resources/control-plane/restart_services.go @@ -35,7 +35,7 @@ func restartSPService(service string) (error, int) { } else { if serviceName, ok := initMap[service]; ok { restartCommandArgs := []string{"restart", serviceName} - cmd := exec.Command("docker-compose", restartCommandArgs...) + cmd := exec.Command("docker compose", restartCommandArgs...) cmd.Dir = "/home/ubuntu/snowplow" err := cmd.Run() if err != nil { @@ -49,7 +49,7 @@ func restartSPService(service string) (error, int) { func restartSPServices() error { restartCommandArgs := []string{"-f", "/home/ubuntu/snowplow/docker-compose.yml", "restart"} - cmd := exec.Command("docker-compose", restartCommandArgs...) + cmd := exec.Command("docker compose", restartCommandArgs...) cmd.Dir = "/home/ubuntu/snowplow" err := cmd.Run() if err != nil { diff --git a/provisioning/resources/init/snowplow_mini.service b/provisioning/resources/init/snowplow_mini.service index 589574dc..35e0c55f 100644 --- a/provisioning/resources/init/snowplow_mini.service +++ b/provisioning/resources/init/snowplow_mini.service @@ -7,9 +7,9 @@ Type=oneshot RemainAfterExit=true WorkingDirectory=/home/ubuntu/snowplow ExecStartPre=/usr/sbin/service docker restart -ExecStartPre=docker-compose down -ExecStart=docker-compose up -d -ExecStop=docker-compose down +ExecStartPre=docker compose down +ExecStart=docker compose up -d +ExecStop=docker compose down [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/provisioning/roles/docker/tasks/main.yml b/provisioning/roles/docker/tasks/main.yml index e79c579a..562edb14 100644 --- a/provisioning/roles/docker/tasks/main.yml +++ b/provisioning/roles/docker/tasks/main.yml @@ -8,7 +8,7 @@ - name: Remove previous containerd version apt: name=containerd.io state=absent -- name: Install docker-compose +- name: Install docker compose v2 apt: name=docker-compose-v2 state=latest - name: Copy docker-compose.yml and its environment file @@ -25,9 +25,9 @@ become: yes shell: echo "vm.max_map_count=262144" >> /etc/sysctl.conf && service procps restart -- name: Start snowplow mini (docker-compose up) +- name: Start snowplow mini (docker compose up) become: yes - shell: cd {{main_dir}} && docker-compose up -d && sleep 20 + shell: cd {{main_dir}} && docker compose up -d && sleep 20 - name: Wait for Elasticsearch port 9200 to become open on the host, don't start checking for 10 seconds wait_for: diff --git a/utils/scripts/user_data.sh b/utils/scripts/user_data.sh index d5afb102..a7c72dc5 100755 --- a/utils/scripts/user_data.sh +++ b/utils/scripts/user_data.sh @@ -8,7 +8,7 @@ password='password' iglu_server_super_uid='deadbeef-dead-beef-dead-beefdeadbeef' # DO NOT ALTER BELOW # -docker-compose -f /home/ubuntu/snowplow/docker-compose.yml restart iglu-server +docker compose -f /home/ubuntu/snowplow/docker-compose.yml restart iglu-server sudo service snowplow_mini_control_plane_api restart sleep 10