diff --git a/.github/workflows/build_test_docker_x86.yaml b/.github/workflows/build_test_docker_x86.yaml index 6a57f75d..e9de389c 100644 --- a/.github/workflows/build_test_docker_x86.yaml +++ b/.github/workflows/build_test_docker_x86.yaml @@ -36,11 +36,17 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{secrets.DOCKERHUB_USERNAME}} + password: ${{secrets.DOCKERHUB_TOKEN}} + - name: Configure AWS run: | aws configure set aws_access_key_id ${{ secrets.aws_access_key_id }} aws configure set aws_secret_access_key ${{ secrets.aws_secret_access_key }} - aws configure set region us-east-1 + aws configure set region us-east-1 3 - name: Install packages for datastream run: | diff --git a/research_datastream/terraform/test/docker_loginNpush.sh b/research_datastream/terraform/test/docker_loginNpush.sh new file mode 100755 index 00000000..d4fd5e31 --- /dev/null +++ b/research_datastream/terraform/test/docker_loginNpush.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ "$(echo $DOCKERHUB_TOKEN | docker login -u $DOCKERHUB_USERNAME --password-stdin)" == "Login Succeeded" ]; then + echo "Docker login successful" + ./scripts/docker_builds.sh -p + echo "Push complete" +else + echo "Docker login failed" + exit 1 +fi \ No newline at end of file diff --git a/research_datastream/terraform/test/execution_gp_arm_docker_buildNtester.json b/research_datastream/terraform/test/execution_gp_arm_docker_buildNtester.json index f9c67ad2..98c59c87 100644 --- a/research_datastream/terraform/test/execution_gp_arm_docker_buildNtester.json +++ b/research_datastream/terraform/test/execution_gp_arm_docker_buildNtester.json @@ -1,9 +1,10 @@ { "commands" : [ + "runuser -l ec2-user -c 'rm -rf /home/ec2-user/ngen-datastream && git clone -b test_terraform https://github.com/CIROH-UA/ngen-datastream.git'", "runuser -l ec2-user -c 'cd /home/ec2-user/ngen-datastream && ./scripts/docker_builds.sh -b'", "runuser -l ec2-user -c 'curl -L -O https://ngen-datastream.s3.us-east-2.amazonaws.com/palisade.gpkg'", "runuser -l ec2-user -c './scripts/stream.sh -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json -n 4'", - "runuser -l ec2-user -c 'echo $(aws secretsmanager get-secret-value --secret-id docker_awiciroh_creds --region us-east-1 --query SecretString --output text | jq -r .DOCKERHUB_TOKEN) | docker login -u $(aws secretsmanager get-secret-value --secret-id docker_awiciroh_creds --region us-east-1 --query SecretString --output text | jq -r .DOCKERHUB_USERNAME) --password-stdin && ./scripts/docker_builds.sh -p'" + "runuser -l ec2-user -c './research_datastream/terraform/test/docker_loginNpush.sh'" ], "run_options":{ "ii_detach_volume" : true,