Genesis
Genesis copied to clipboard
[MISC] Add minimal Dockerfile
This pull request adds a minimal workable Dockerfile to run Genesis.
To run it, first build the docker:
docker build -t genesis .
Then run it using the following command:
xhost +
docker run --gpus all --rm -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix genesis python examples/tutorials/hello_genesis.py
Thank you! Could you add something to readme with explanations?
Thank you! Could you add something to readme with explanations?
Sure, happy to. I'll ping you once I'm finished.
Can you add a docker-compose
https://github.com/ETSTribology/Genesis/blob/main/Dockerfile
my version
services:
genesis:
build:
context: .
dockerfile: Dockerfile
image: genesis:latest
runtime: nvidia
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
command: python examples/tutorials/hello_genesis.py
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
Can you add a docker-compose
https://github.com/ETSTribology/Genesis/blob/main/Dockerfile
my version
services: genesis: build: context: . dockerfile: Dockerfile image: genesis:latest runtime: nvidia environment: - DISPLAY=${DISPLAY} volumes: - /tmp/.X11-unix:/tmp/.X11-unix command: python examples/tutorials/hello_genesis.py deploy: resources: reservations: devices: - capabilities: [gpu]
Thanks! I have included this version of compose file to this pull request.
Hi @zhouxian , can you take a look? I have updated both the English and Chinese version of the READMEs. Also added a docker-compose.yml file and instructions thanks to @antoinebou12 .
You could also make a action to auto deploy to dockerhub
name: Build and Push Docker Images
on:
push:
branches:
- main
- docker
pull_request:
branches:
- main
- docker
jobs:
build-and-push-standard:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: docker-${{ runner.os }}-${{ hashFiles('Dockerfile', '**/*.cpp', '**/*.h') }}
restore-keys: |
docker-${{ runner.os }}-
- name: Build and Push Standard Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/Genesis:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
platforms: linux/amd64
- name: Test Standard Docker Image
run: |
docker run --rm ${{ secrets.DOCKER_USERNAME }}/Genesis:latest --help
@Kashu7100 any idea how we proceed with this?
Thanks for your contribution! However, we already have another commit for the Dockerfile. We will acknowledge your help in our next release notes!