Skip to content

Commit

Permalink
Update Docker image to 0.3.0 (scalabel#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
fyu authored May 11, 2022
1 parent f939f21 commit 06b763a
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 1,187 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --ignore-installed -r scripts/requirements.txt
python3 -m pip install --ignore-installed -r scripts/optional.txt
python3 -m pip install --ignore-installed -r scripts/requirements-opt.txt
python3 -m pip install --ignore-installed -r scripts/requirements-dev.txt
- name: Build mypy cache
continue-on-error: true
run: python3 -m mypy scalabel
Expand Down Expand Up @@ -59,8 +60,9 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install --ignore-installed -r scripts/requirements.txt
pip install --ignore-installed -r scripts/optional.txt
python3 -m pip install --ignore-installed -r scripts/requirements.txt
python3 -m pip install --ignore-installed -r scripts/requirements-opt.txt
python3 -m pip install --ignore-installed -r scripts/requirements-dev.txt
- name: Build
run: python3 setup.py sdist bdist_wheel
- name: Test
Expand All @@ -85,8 +87,9 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install --ignore-installed -r scripts/requirements.txt
pip install --ignore-installed -r scripts/optional.txt
python3 -m pip install --ignore-installed -r scripts/requirements.txt
python3 -m pip install --ignore-installed -r scripts/requirements-opt.txt
python3 -m pip install --ignore-installed -r scripts/requirements-dev.txt
- name: Build
run: python3 setup.py sdist bdist_wheel
- name: Test
Expand Down Expand Up @@ -136,3 +139,17 @@ jobs:
run: npm test
- name: Build
run: npx webpack --config webpack.config.js --mode=production

deploy-docker:
name: build docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: .
load: true
tags: scalabel/www:test
27 changes: 27 additions & 0 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will deploy the current docker image to docker hub
name: deploy docker
on:
push:
branches:
- master

jobs:
deploy:
name: build and push docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: scalabel/www:latest
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
curl \
git \
libopenmpi-dev \
python3.8 \
python3.8-dev \
python3-pip \
Expand All @@ -34,7 +35,9 @@ COPY . .
RUN python3.8 -m pip install --upgrade pip && \
python3.8 -m pip install -r scripts/requirements.txt

RUN npm install -g npm@latest && npm install --max_old_space_size=8000
RUN python3.8 setup.py install

RUN npm install -g npm@latest && npm ci --max_old_space_size=8000


RUN ./node_modules/.bin/webpack --config webpack.config.js --mode=production; \
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@ npm run serve

Open your browser and go to [http://localhost:8686](http://localhost:8686) to use Scalabel. You can check our project [configuration examples](./examples/) to create some sample projects.

We also provide docker image to avoid installing the libraries. To pull the image:

```bash
docker pull scalabel/www
```

Launch the server through docker

```bash
docker run -it -v "`pwd`/local-data:/opt/scalabel/local-data" -p \
8686:8686 -p 6379:6379 scalabel/www \
node app/dist/main.js \
--config /opt/scalabel/local-data/scalabel/config.yml \
--max-old-space-size=8192
```

The Python API can be installed through `pip`:

```bash
python3 -m pip install scalabel
```

For other operating systems or if you wish to use the Docker image, please refer to the [installation guide](https://doc.scalabel.ai/setup.html).

<br>
Expand Down
Loading

0 comments on commit 06b763a

Please sign in to comment.