Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "chore(deps): update rust docker tag to v1.80" #5566

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/pr-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,58 @@ jobs:
uploadJavaScriptArtifacts: false
secrets: inherit

# Run Docker image
run-docker:
name: run-docker
runs-on: ubuntu-22.04
needs: build-rust
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- name: Run Docker image
run: |
# Create router.yaml
cat << EOF > router.yaml
supergraph:
listen: 0.0.0.0:4000
health_check:
listen: 0.0.0.0:8088
enabled: true
path: /health
plugins:
hive.usage:
enabled: false
EOF

# Download supergraph
curl -sSL https://supergraph.demo.starstuff.dev/ > ./supergraph.graphql

# Run Docker image
docker run -p 4000:4000 -p 8088:8088 --name apollo_router_test -d \
--env HIVE_TOKEN="fake" \
--mount "type=bind,source=/$(pwd)/router.yaml,target=/dist/config/router.yaml" \
--mount "type=bind,source=/$(pwd)/supergraph.graphql,target=/dist/config/supergraph.graphql" \
ghcr.io/kamilkisiela/graphql-hive/apollo-router:${{ github.event.pull_request.head.sha }} \
--log debug \
--supergraph /dist/config/supergraph.graphql \
--config /dist/config/router.yaml

# Wait for the container to be ready
echo "Waiting for the container to be ready..."
sleep 20
HTTP_RESPONSE=$(curl --retry 5 --retry-delay 5 --max-time 30 --write-out "%{http_code}" --silent --output /dev/null "http://127.0.0.1:8088/health")

# Check if the HTTP response code is 200 (OK)
if [ $HTTP_RESPONSE -eq 200 ]; then
echo "Health check successful."
docker stop apollo_router_test
docker rm apollo_router_test
exit 0
else
echo "Health check failed with HTTP status code $HTTP_RESPONSE."
docker stop apollo_router_test
docker rm apollo_router_test
exit 1
fi
# Builds binaries from Rust crates
build-rust-binaries:
name: build-rust-binaries
Expand Down
2 changes: 1 addition & 1 deletion docker/router.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FROM scratch AS config

# Stick to v1.76 due to this issue: https://github.com/apollographql/router/issues/5084
FROM rust:1.80 as build
FROM rust:1.76 as build

Check warning on line 6 in docker/router.dockerfile

View workflow job for this annotation

GitHub Actions / build_rust / build-and-dockerize

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# Required by Apollo Router
RUN apt-get update
Expand Down Expand Up @@ -32,15 +32,15 @@
RUN cargo build --release

# Runtime
FROM debian:12-slim as runtime

Check warning on line 35 in docker/router.dockerfile

View workflow job for this annotation

GitHub Actions / build_rust / build-and-dockerize

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

RUN apt-get update
RUN apt-get -y install ca-certificates
RUN rm -rf /var/lib/apt/lists/*

LABEL org.opencontainers.image.title=$IMAGE_TITLE

Check warning on line 41 in docker/router.dockerfile

View workflow job for this annotation

GitHub Actions / build_rust / build-and-dockerize

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$IMAGE_TITLE' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LABEL org.opencontainers.image.version=$RELEASE

Check warning on line 42 in docker/router.dockerfile

View workflow job for this annotation

GitHub Actions / build_rust / build-and-dockerize

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$RELEASE' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LABEL org.opencontainers.image.description=$IMAGE_DESCRIPTION

Check warning on line 43 in docker/router.dockerfile

View workflow job for this annotation

GitHub Actions / build_rust / build-and-dockerize

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$IMAGE_DESCRIPTION' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LABEL org.opencontainers.image.authors="The Guild"
LABEL org.opencontainers.image.vendor="Kamil Kisiela"
LABEL org.opencontainers.image.url="https://github.com/kamilkisiela/graphql-hive"
Expand Down
Loading