chore: populate GITHUB_TOKEN for camoufox fetch in CI#735
chore: populate GITHUB_TOKEN for camoufox fetch in CI#735
GITHUB_TOKEN for camoufox fetch in CI#735Conversation
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
…arg propagation Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
GITHUB_TOKEN for camoufox fetch in CI
| # Build the image with a unique tag | ||
| image_tag="test-$(basename "$template_dir")-$(date +%s)" | ||
| if docker build -f "./Dockerfile" -t "$image_tag" . --progress=plain; then | ||
| if docker build -f "./Dockerfile" -t "$image_tag" --build-arg GITHUB_TOKEN . --progress=plain; then |
There was a problem hiding this comment.
build-arg is unsuitable for passing secrets, but since build-time secrets are a BuildKit feature (which afaik, isn't a thing on Apify Platform yet), this seems to be our best bet.
Since github.token is ephemeral, it shouldn't harm our testing setup, but caution is required nonetheless.
|
Why are these templates still manually fetching camoufox browsers when we have images with it preinstalled? Is this just a case of we forgot to update? 🫠 |
Right, I missed that completely. I'm not sure how / where the original Python Camoufox stores the |
|
Also to keep in mind that python-playwright is now a super fat image, so we definitely need to change the templates 👀👀 |
|
Update on this:
Possible solutions: A) Somehow include the GeoIP db in the base image (preferable, but maybe there's a reason why we're not doing this yet). |
|
2 surprises me dearly, as we do use |
|
I looked deeper into this, and I believe apify/apify-actor-docker#282 should fix this. It seems there will be additional age checks in the upcoming Camoufox for Python versions, but we'll cross that bridge when we get there, I guess. For now, this ⬆️ should fix it. |
Installs Camoufox with the `geoip` extra. This causes `camoufox fetch` to fetch both the browser binary and the `mmdb` database for geographical IP lookup. `geoip` is used by default in the [Apify Python Camoufox template](https://github.com/apify/actor-templates/blob/master/templates/python-crawlee-playwright-camoufox/requirements.txt), which leads to discrepancies when trying to use the template with the Docker image. Related to apify/actor-templates#735
Populates the
GITHUB_TOKENenvvar to bump the GitHub API rate limits when fetching Camoufox releases. This is read e.g. here.This should unblock our unstable CI tests.