Skip to content

Commit

Permalink
readme to dockerignore; updated Taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ToshY committed Dec 26, 2022
1 parent 9697e81 commit bb85602
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ __pycache__
.task
Taskfile.yml
output
examples
examples
README.md
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-slim

ENV PIP_ROOT_USER_ACTION=ignore
ENV PIP_ROOT_USER_ACTION ignore

WORKDIR /app

Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ docker build -t t0shy/bunnynet-ai:latest --no-cache .
2. Run it.

```shell
docker run -it -v ${PWD}/output:/app/output --rm t0shy/bunnynet-ai:latest python3 main.py -k "489eb71e-1259-4e1a-83c2-2d7859eec469" -hn "myzone.b-cdn.net" -p "cute pixel art of a bunny with a colorful solid background" -n 5 -v
docker run -it --rm -v ${PWD}/output:/app/output t0shy/bunnynet-ai:latest python3 main.py -k "489eb71e-1259-4e1a-83c2-2d7859eec469" -hn "myzone.b-cdn.net" -p "cute pixel art of a bunny with a colorful solid background" -n 5 -v
```

#### Docker Compose
Expand All @@ -80,10 +80,10 @@ docker compose up -d --remove-orphans
3. Run it.

```shell
docker compose run bunnynet-ai python3 main.py -k "489eb71e-1259-4e1a-83c2-2d7859eec469" -hn "myzone.b-cdn.net" -p "cute pixel art of a bunny with a colorful solid background" -n 5 -v
docker compose run --rm bunnynet-ai python main.py -k "489eb71e-1259-4e1a-83c2-2d7859eec469" -hn "myzone.b-cdn.net" -p "cute pixel art of a bunny with a colorful solid background" -n 5 -v
```

3. Saved images can be found on the mounted directory of the host machine.
4. Saved images can be found on the mounted directory of the host machine.
* Filename format is as follows: `[{image_blueprint}]{slug_prompt}-{seed}.{file_extension}`.

### 🐍 Python
Expand Down Expand Up @@ -120,12 +120,6 @@ Setting up `pre-commit` code style & quality checks for local development.
pre-commit install
```

### Create service

```shell
task up
```

### Checks

```shell
Expand Down
16 changes: 7 additions & 9 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ version: '3'

vars:
SERVICE: bunnynet-ai
REPO: t0shy/bunnynet-ai
TAG: latest

tasks:
default:
Expand All @@ -19,18 +17,18 @@ tasks:
Example:
- task run -- -k "489eb71e-1259-4e1a-83c2-2d7859eec469" -hn "myzone.b-cdn.net" -p "cute pixel art of a bunny with a colorful solid background" -n 5 -v
cmds:
- docker compose run {{.SERVICE}} python3 main.py {{.CLI_ARGS | default "-h"}}
- docker compose run --rm {{.SERVICE}} python main.py {{.CLI_ARGS | default "-h"}}

# Docker
up:
desc: Up service
cmds:
- docker compose up -d --build --remove-orphans --force-recreate
- docker compose up -d {{.CLI_ARGS | default "--build --remove-orphans --force-recreate"}}

down:
desc: Down service
cmds:
- docker compose down --remove-orphans
- docker compose down {{.CLI_ARGS | default "--rmi local --remove-orphans"}}

# Tools
contribute:
Expand All @@ -42,19 +40,19 @@ tasks:
tools:pylint:
desc: Run pylint
cmds:
- docker compose run {{.SERVICE}} pylint --max-line-length=120 --recursive=y .
- docker compose run --rm {{.SERVICE}} pylint --max-line-length=120 --recursive=y .

tools:pycodestyle:
desc: Run pycodestyle
cmds:
- docker compose run {{.SERVICE}} pycodestyle --max-line-length=120 --show-source .
- docker compose run --rm {{.SERVICE}} pycodestyle --max-line-length=120 --show-source .

tools:black:check:
desc: Run black dryrun
cmds:
- docker compose run {{.SERVICE}} black . --diff --color
- docker compose run --rm {{.SERVICE}} black . --diff --color

tools:black:fix:
desc: Run black
cmds:
- docker compose run {{.SERVICE}} black .
- docker compose run --rm {{.SERVICE}} black .

0 comments on commit bb85602

Please sign in to comment.