Skip to content

Commit

Permalink
331 dockerhub rate limit - Github Actions aissemble-fastapi, build mu…
Browse files Browse the repository at this point in the history
…ltiple times
  • Loading branch information
colinpalmer-pro committed Sep 19, 2024
1 parent 526d42c commit 8ad817c
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 52 deletions.
15 changes: 12 additions & 3 deletions .github/test-files/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ else
fi

# run through continuous pulls
#for i in $(seq 1 5); do
# echo "Pulling busybox, attempt $i"
# docker pull busybox || { echo "Failed on attempt $i"; exit 1; }
# docker rmi busybox || { echo "Failed to remove image on attempt $i"; exit 1; }
#done

for i in $(seq 1 5); do
echo "Pulling busybox, attempt $i"
docker pull busybox || { echo "Failed on attempt $i"; exit 1; }
docker rmi busybox || { echo "Failed to remove image on attempt $i"; exit 1; }
echo "Running iteration $i"
# mvn line
if [ $? -ne 0 ]; then
echo "Build failed on iteration $i"
exit 1
fi
done
58 changes: 32 additions & 26 deletions .github/workflows/build2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,32 @@ jobs:
uses: gabrielfalcao/pyenv-action@v18
with:
default: 3.11.4
- name: Load m2 repository cache # Manually caching .m2 repo as the setup-java caching isn't falling back to older caches
id: cached-m2-repo
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: Load m2 build cache
id: cached-m2-build
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: maven-build-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-build-cache-
# - name: Load m2 repository cache # Manually caching .m2 repo as the setup-java caching isn't falling back to older caches
# id: cached-m2-repo
# uses: actions/cache@v4
# with:
# path: ~/.m2/repository
# key: maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# maven-
# - name: Load m2 build cache
# id: cached-m2-build
# uses: actions/cache@v4
# with:
# path: ~/.m2/build-cache
# key: maven-build-cache-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# maven-build-cache-
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Poetry cache
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
poetry-
# - name: Poetry cache
# id: cached-poetry
# uses: actions/cache@v4
# with:
# path: ~/.cache/pypoetry
# key: poetry-cache-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# poetry-
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
Expand All @@ -94,8 +94,14 @@ jobs:
# Run build with the gh-build profile
- name: Build aiSSEMBLE
run: |
./mvnw -B clean install -U -Dmaven.build.cache.skipCache=true -Ddocker.nocache=true -pl :aissemble-fastapi -Pci,integration-test,gh-build --settings $HOME/.m2/settings.xml
docker image ls | grep "ghcr.io/boozallen/aissemble-fastapi" || echo "Image not found"
for i in $(seq 1 110); do
echo "Running iteration $i"
./mvnw -B clean install -U -Dmaven.build.cache.skipCache=true -Ddocker.noCache=true -pl :aissemble-fastapi -Pci,integration-test,gh-build docker:build --settings $HOME/.m2/settings.xml
if [ $? -ne 0 ]; then
echo "Build failed on iteration $i"
exit 1
fi
done
# Install Maven which is needed for archetype tests
# - name: Set up Maven
# uses: stCarolas/setup-maven@v5
Expand Down
45 changes: 22 additions & 23 deletions extensions/extensions-docker/aissemble-fastapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,30 @@
<groupId>${group.fabric8.plugin}</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<verbose>true</verbose>
<logAll>true</logAll>
<logStdout>true</logStdout>
<showLogs>true</showLogs>
<buildArgs>
<noCache>true</noCache>
</buildArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>${project.basedir}/src/main/resources/docker/scripts/check-docker-auth.sh</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>exec-maven-plugin</artifactId>-->
<!-- <version>3.0.0</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>validate</phase>-->
<!-- <goals>-->
<!-- <goal>exec</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <executable>bash</executable>-->
<!-- <arguments>-->
<!-- <argument>${project.basedir}/src/main/resources/docker/scripts/check-docker-auth.sh</argument>-->
<!-- </arguments>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</build>

Expand Down

0 comments on commit 8ad817c

Please sign in to comment.