feat: Scaleway Serverless Containers deployment setup#349
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughAdds Scaleway deployment support and a Caddy reverse proxy: new Scaleway env vars and lint directive, CI/CD switched to in-repo Scaleway deployment, a deploy script and justfile target, Caddy installed and configured in image and supervisord, and compose/port mapping adjusted. Changes
Sequence Diagram(s)sequenceDiagram
actor Dev as Developer
participant GH as GitHub Actions
participant DockerReg as Scaleway Registry
participant SCW as Scaleway API (scw CLI)
participant Container as Scaleway Container
Dev->>GH: push commit / trigger workflow
GH->>DockerReg: docker build && docker push (image:repo:tag)
GH->>SCW: scw login (use SCW_* env vars)
GH->>SCW: find container by name
alt container found
GH->>SCW: update container image & port
GH->>SCW: trigger container deployment
SCW->>Container: deploy new image
Container-->>GH: deployment status / URL
else not found
SCW-->>GH: error: container not found
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In @.env.example:
- Around line 56-60: The .env.example SCW entries are out of alphabetical order
and trigger dotenv-linter; reorder the SCW_* variables to alphabetical order
(SCW_ACCESS_KEY, SCW_DEFAULT_ORGANIZATION_ID, SCW_DEFAULT_PROJECT_ID,
SCW_SECRET_KEY) in the file and keep the placeholder values intact so linting
passes; update the block containing SCW_ACCESS_KEY, SCW_SECRET_KEY,
SCW_DEFAULT_ORGANIZATION_ID, SCW_DEFAULT_PROJECT_ID accordingly.
In @.github/workflows/build_and_deploy.yml:
- Around line 92-102: The scw commands use unquoted variable expansions which
can cause word-splitting/globbing; update the invocations that reference
CONTAINER_NAME, CONTAINER_ID and FULL_IMAGE_NAME (the scw container container
list and scw container container update calls) to wrap those variables in double
quotes (e.g., "$CONTAINER_NAME", "$CONTAINER_ID", "$FULL_IMAGE_NAME") so values
with spaces or special chars are handled safely and reliably.
In `@Dockerfile`:
- Around line 15-21: The Dockerfile's Caddy install RUN step fails because the
image lacks gpg; update the apt-get install list in the RUN block that runs
"apt-get update && apt-get install -y debian-keyring debian-archive-keyring
apt-transport-https curl ..." to also install gnupg (so the "gpg --dearmor -o
/usr/share/keyrings/caddy-stable-archive-keyring.gpg" command succeeds), keep
the rest of the chained commands the same, and ensure apt-get clean && rm -rf
/var/lib/apt/lists/* remains at the end.
In `@scripts/deploy_to_scaleway.sh`:
- Around line 12-21: Add a dependency check for the jq binary similar to the
existing checks for scw and docker: detect jq with "command -v jq &> /dev/null",
print a clear error like "Error: jq is not installed." and exit with non-zero
status if missing; update the same dependency-check block (the shell snippet
that currently checks scw and docker) to include this jq check so later uses of
jq fail early with a helpful message.
- Around line 7-10: The REPO_NAME extraction can produce an empty or invalid
value leading to a broken IMAGE_NAME; update the script to validate and fall
back when REPO_NAME is empty or doesn't match expected pattern: detect if
REPO_NAME (the variable created by the git/sed pipeline) is empty or contains
invalid characters, and if so set REPO_NAME to a safe default (e.g.,
"unknown-repo" or derive from git basename of remote URL) before constructing
IMAGE_NAME and IMAGE_TAG; ensure IMAGE_NAME="ghcr.io/${REPO_NAME}/evalap" only
happens after this validation and use IMAGE_TAG (git rev-parse --short HEAD)
unchanged.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/pr_checks.yml:
- Around line 63-66: The workflow step named "Lint .env files" currently uses
dotenv-linter/action-dotenv-linter@v2; update that to
dotenv-linter/action-dotenv-linter@v4.0.0 to align with the pre-commit hook
(dotenv-linter@v4.0.0) and keep the existing with: dotenv_linter_flags: --skip
UnorderedKey unchanged so CI and local linting behavior match.
Description
This PR replaces the GitLab deployment trigger with a direct Scaleway Serverless Containers deployment mechanism.
Key Changes:
build_and_deploy.ymlto usescaleway/action-scwand the Scaleway CLI for direct deployment.Dockerfileto install Caddy and include the new proxy configuration.scripts/deploy_to_scaleway.sh(reachable viajust deploy-scaleway) for manual building and deployment from a local machine..env.examplewith the required Scaleway credentials.Deployment Instructions:
SCW_ACCESS_KEYSCW_SECRET_KEYSCW_DEFAULT_ORGANIZATION_IDSCW_DEFAULT_PROJECT_ID.envfile.evalapcontainer is created in Scaleway (regionfr-par).evalap.etalab.gouv.frshould be configured in Scaleway for TLS termination.Summary by CodeRabbit
Infrastructure & Deployment
Runtime & Routing
Configuration & CI
✏️ Tip: You can customize this high-level summary in your review settings.