Skip to content

Commit

Permalink
Merge pull request #236 from Szubie/docs-modern-bravefiles
Browse files Browse the repository at this point in the history
Docs modern bravefiles
  • Loading branch information
idroz committed Dec 16, 2022
2 parents 06efc06 + 88dd662 commit a748af9
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 74 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Available Commands:
remove Remove Units or Images
start Start Units
stop Stop Units
template Generate a template Bravefile
umount Unmount <disk> from UNIT
units List Units
version Show current bravetools version
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/bravefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ The minimal structural unit of a Bravefile is an **Entry**. ``Bravefile`` suppor
### image
`image` refers to the target image to be built using the instractions in your ``Bravefile``. General syntax is [NAME]/[VERSION]/[ARCH]. If [ARCH] is not specified, Bravetools will automatically determine your host's CPU architecture and build an appropriate image.

Image name defined at the top of a ``Bravefile`` will also be used in the

```yaml
image: alpine-python3/1.0
```
Expand Down Expand Up @@ -129,15 +127,11 @@ Controls image properties, such as name, version, and run-time configuration. It

```yaml
service:
#image is required in this section if it was not specified at the top of your Bravefile
image: alpine-python3/1.0
image: alpine-python3/1.0 # If not specified at top of file
name: python3
# Profile name is optional and defaults to your local profile if deploying locally
profile: brave
# Networl name is optional and defaults to your local LXD network
network: lxdbr0
# Storage device is optional and defaults to your local LXD storage device
storage: brave-deploy-disk
profile: brave # Optional, defaults to your local LXD profile
network: lxdbr0 # Optional, defaults to your local LXD network bridge
storage: brave-deploy-disk # Optional, defaults to your local LXD storage device
ip: ""
ports: []
postdeploy:
Expand Down
1 change: 0 additions & 1 deletion docs/intro/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ packages:
- python3
service:
name: alpine-edge-python3
image: alpine-python3/1.0
resources:
ram: "4GB"
cpu: 2
Expand Down
19 changes: 9 additions & 10 deletions examples/go-service/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: go-service/1.0

base:
image: ubuntu/xenial
location: public
Expand All @@ -21,6 +23,13 @@ run:
- --classic

service:
name: go-service
ip: 10.167.7.15
ports:
- 3000:3000
resources:
ram: 1GB
cpu: 1
postdeploy:
run:
- command: go
Expand All @@ -32,13 +41,3 @@ service:
- -c
content: |-
./main >std.txt 2>err.txt &

image: go-service-1.0
name: go-service
version: 1.0
ip: 10.167.7.15
ports:
- 3000:3000
resources:
ram: 1GB
cpu: 1
17 changes: 8 additions & 9 deletions examples/python-multi-service-base/api/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: python-api/1.0

base:
image: python-base-1.0
location: local
Expand All @@ -7,19 +9,16 @@ copy:
target: /root/

service:
postdeploy:
run:
- command: sh
args:
- -c
- 'AUTH_ADDR=10.0.0.15:80 LOG_ADDR=10.0.0.25:8000 gunicorn app:app --bind 0.0.0.0:5000 --daemon'

image: python-api-1.0
name: python-api
version: 1.0
ip: 10.0.0.5
ports:
- 5000:5000
resources:
ram: 500MB
cpu: 1
postdeploy:
run:
- command: sh
args:
- -c
- 'AUTH_ADDR=10.0.0.15:80 LOG_ADDR=10.0.0.25:8000 gunicorn app:app --bind 0.0.0.0:5000 --daemon'
15 changes: 7 additions & 8 deletions examples/python-multi-service-base/auth/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: python-auth/1.0

base:
image: python-base-1.0
location: local
Expand All @@ -7,17 +9,14 @@ copy:
target: /root/

service:
name: python-auth
ip: 10.0.0.15
resources:
ram: 500MB
cpu: 1
postdeploy:
run:
- command: sh
args:
- -c
- gunicorn app:app --bind 0.0.0.0:80 --daemon

image: python-auth-1.0
name: python-auth
version: 1.0
ip: 10.0.0.15
resources:
ram: 500MB
cpu: 1
4 changes: 2 additions & 2 deletions examples/python-multi-service-base/base/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: python-base/1.0

base:
image: alpine/3.16
location: public
Expand All @@ -22,6 +24,4 @@ run:
- requirements.txt

service:
image: python-base-1.0
name: python-base
version: 1.0
16 changes: 8 additions & 8 deletions examples/python-multi-service-base/log/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
image: python-log/1.0


base:
image: python-base-1.0
location: local
Expand All @@ -7,17 +10,14 @@ copy:
target: /root/

service:
name: python-log
ip: 10.0.0.25
resources:
ram: 500MB
cpu: 1
postdeploy:
run:
- command: sh
args:
- -c
- gunicorn app:app --bind 0.0.0.0:8000 --daemon

image: python-log-1.0
name: python-log
version: 1.0
ip: 10.0.0.25
resources:
ram: 500MB
cpu: 1
17 changes: 8 additions & 9 deletions examples/python-multi-service/api/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: python-api/1.0

base:
image: alpine/edge
location: public
Expand All @@ -24,19 +26,16 @@ run:
- requirements.txt

service:
postdeploy:
run:
- command: sh
args:
- -c
- 'AUTH_ADDR=10.0.0.15:80 LOG_ADDR=10.0.0.25:8000 gunicorn app:app --bind 0.0.0.0:5000 --daemon'

image: python-api-1.0
name: python-api
version: 1.0
ip: 10.0.0.5
ports:
- 5000:5000
resources:
ram: 500MB
cpu: 1
postdeploy:
run:
- command: sh
args:
- -c
- 'AUTH_ADDR=10.0.0.15:80 LOG_ADDR=10.0.0.25:8000 gunicorn app:app --bind 0.0.0.0:5000 --daemon'
17 changes: 8 additions & 9 deletions examples/python-multi-service/auth/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: python-auth/1.0

base:
image: alpine/edge
location: public
Expand All @@ -24,17 +26,14 @@ run:
- requirements.txt

service:
postdeploy:
run:
- command: sh
args:
- -c
- gunicorn app:app --bind 0.0.0.0:80 --daemon

image: python-auth-1.0
name: python-auth
version: 1.0
ip: 10.0.0.15
resources:
ram: 500MB
cpu: 1
postdeploy:
run:
- command: sh
args:
- -c
- gunicorn app:app --bind 0.0.0.0:80 --daemon
15 changes: 7 additions & 8 deletions examples/python-multi-service/log/Bravefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
image: python-log/1.0

base:
image: alpine/edge
location: public
Expand All @@ -24,17 +26,14 @@ run:
- requirements.txt

service:
name: python-log
ip: 10.0.0.25
resources:
ram: 500MB
cpu: 1
postdeploy:
run:
- command: sh
args:
- -c
- gunicorn app:app --bind 0.0.0.0:8000 --daemon

image: python-log-1.0
name: python-log
version: 1.0
ip: 10.0.0.25
resources:
ram: 500MB
cpu: 1

0 comments on commit a748af9

Please sign in to comment.