Closed Edvinas01 closed 2 months ago
I think the runner and cache server need to be in the same docker network. Maybe try this:
services:
cache-server:
image: ghcr.io/falcondev-oss/github-actions-cache-server:2.1.2
ports:
- '3000:3000'
environment:
CLEANUP_OLDER_THAN_DAYS: 30
URL_ACCESS_TOKEN: SOME_TOKEN
# this should also be updated
API_BASE_URL: http://cache-server:3000
volumes:
- cache-data:/app/.data
# add network
networks:
- default
actions-runner:
build:
context: actions-runner
args:
RUNNER_VERSION: 2.316.1
environment:
- GITHUB_ORG=SOME_ORG
- ACTIONS_CACHE_URL=http://cache-server:3000/SOME_TOKEN/
- RUNNER_LABELS=self-hosted,docker,linux,x64
- RUNNER_GROUP=Custom
- RUNNER_NAME=docker-actions-runner
env_file:
- '.actions-runner.secrets.env'
# add network
networks:
- default
volumes:
cache-data:
# add network
networks:
default:
Ugh, I feel dumb 😅 The job in my workflow was using another self-hosted runner, due to which it was unable to reach the one running locally on my machine - essentially some jobs ran on the cloud (self-hosted) while some on my local machine as I completely forgot that runs-on
is used three times in my workflow. I'm surprised only caching was broken >.> Now it is working as intended!
I didn't have to add networks
entries you mentioned or adjust the URL in API_BASE_URL
though 🤔
Anyway, thanks for the quick reply and sorry for wasting time, will close the issue.
Issue
I'm trying to Dockerize my GitHub actions runner and github-actions-cache-server so I could scale it easier. When running the cache action, I'm encountering
getaddrinfo ENOTFOUND cache-server
warning which results in cache restoration/creation not working:If I try to execute
curl "${ACTIONS_CACHE_URL}"
in my actions, I get a valid response.Details
Here is my runner
Dockerfile
:The Docker compose file:
Other
I've tried the solution mentioned in https://github.com/falcondev-oss/github-actions-cache-server/issues/18 (setting
API_BASE_URL: http://localhost:3000
toAPI_BASE_URL: http://cache-server:3000
if I understood it correctly), however it did not yield any results.I've also tried removing the scheme from
ACTIONS_CACHE_URL
(ACTIONS_CACHE_URL: cache-server:3000/SOME_TOKEN/
), this resulted in the following error: