Skip to content

Rudolfs

Alex Feinstein edited this page Mar 31, 2020 · 1 revision

Rudolfs

Rudolfs is a LFS caching and proxy server with AWS S3 backend.

Usage

Add and commit .lfsconfig to the root of your Git repository

[lfs]
    url = "http://localhost:8080/api/my-org/my-project"

It is also recommended to apply the following changes to the config

    # Increase the number of worker threads
    git config --global lfs.concurrenttransfers 64
    
    # Use a global LFS cache to make re-cloning faster
    git config --global lfs.storage ~/.cache/lfs

Run in Docker

    # Run server
    docker run --rm \
    --name lfs \
    -p 8080:8080 \
    -v ${LFS_CACHE_PATH}:/data \
    -e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
    -e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
    -e AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} \
    psxcode/rudolfs \
    --cache-dir=/data \
    --s3-bucket=${LFS_BUCKET_NAME} \
    --max-cache-size=${LFS_MAX_CACHE_SIZE}GB

Run with Docker Compose

Create .env file

AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXQ
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AWS_DEFAULT_REGION=us-west-1
LFS_ENCRYPTION_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LFS_S3_BUCKET=my-bucket
LFS_MAX_CACHE_SIZE=10GB

Create docker-compose.yml

version: '3'
services:
  lfs:
    image: "psxcode/rudolfs:latest"
    ports:
      - "8080:8080"
    volumes:
      - ${LFS_CACHE_PATH}:/data
    restart: always
    environment:
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_DEFAULT_REGION
      - LFS_S3_BUCKET
      - LFS_MAX_CACHE_SIZE
      - LFS_CACHE_PATH
    entrypoint:
      - /tini
      - --
      - /rudolfs
      - --cache-dir
      - /data
      - --s3-bucket
      - ${LFS_S3_BUCKET}
      - --max-cache-size
      - ${LFS_MAX_CACHE_SIZE}

Run it

docker-compose up lfs
Clone this wiki locally