falcondev-oss / github-actions-cache-server

Self-hosted GitHub Actions cache server implementation. Compatible with official 'actions/cache' action
https://gha-cache-server.falcondev.io
MIT License
92 stars 4 forks source link

Error when download cache #18

Closed johnitvn closed 4 months ago

johnitvn commented 4 months ago

I get this warning

Warning: Failed to restore: downloadCache failed: connect ECONNREFUSED 127.0.0.1:3000

docker-compose.yaml

version: "3.7"

name: github-runner
services:

  github-runner:
    build: .
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      RUNNER_NAME_PREFIX: runner
      RUNNER_SCOPE: repo
      ACTIONS_CACHE_URL: http://github-runner-cache:3000/3985tghjoarieht394uhg87ey/
      REPO_URL: https://github.com/johnitvn/vanila
      ACCESS_TOKEN: [TOKEN]
      EPHEMERAL: 1

    deploy:
      replicas: 3
      resources:
        limits:
          cpus: '1.2'
          memory: 1.5G
        reservations:
          cpus: '0.2'
          memory: 256M

  github-runner-cache:
    container_name: github-runner-cache
    image: ghcr.io/falcondev-it/github-actions-cache-server:latest
    ports:
      - '3000:3000'
    environment:
      CACHE_SERVER_TOKEN: 3985tghjoarieht394uhg87ey
      BASE_URL: http://localhost:3000
      SECRET: 578943hgfoir3hqjtgoi
      MINIO_BUCKET: gh-actions-cache
      MINIO_ACCESS_KEY: access_key
      MINIO_SECRET_KEY: secret_key
      MINIO_ENDPOINT: github-runner-minio
      MINIO_PORT: '9000'
      MINIO_USE_SSL: 'false'
      NITRO_PORT: '3000'
    depends_on:
      - github-runner-minio
      - github-runner-minio-mc

  github-runner-minio-mc:
    image: minio/mc
    depends_on:
      - github-runner-minio
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc alias set myminio http://github-runner-minio:9000 access_key secret_key;
      /usr/bin/mc mb myminio/gh-actions-cache;
      /usr/bin/mc policy set public myminio/gh-actions-cache;
      exit 0;
      "

networks:
  default:
    name: server-net
    external: true

And Dockerfile

FROM myoung34/github-runner

RUN sed -i 's/\x41\x00\x43\x00\x54\x00\x49\x00\x4F\x00\x4E\x00\x53\x00\x5F\x00\x43\x00\x41\x00\x43\x00\x48\x00\x45\x00\x5F\x00>



How can I fixed this?
DrJume commented 4 months ago

Can you show the logs of your GHA cache container? Also, how is your minio container configured? It is referenced but missing from the Dockerfile you provided.

LouisHaftmann commented 4 months ago

Try changing the BASE_URL env variable of the cache server to http://github-runner-cache:3000

LouisHaftmann commented 4 months ago

I'll mark this as fixed for now. Feel free to reopen if it still doesn't work :D