Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some notes on getting started on developing for buildomat #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Getting started for developing buildomat

Buildomat needs to run on an illumos system


- `mkdir buildomat_stuff`

- `cd buildomat_stuff`

- `mkdir data`

- `touch data/data.sqlite3`

- create a sample `server.toml` file

```
[admin]
token = "<ADMIN TOKEN>"
hold = false

[general]
baseurl = "NOTUSED"

[storage]
access_key_id = "YOUR VALUE"
secret_access_key = "YOUR VALUE"
bucket = "YOUR VALUE"
prefix = "YOUR VALUE"
region = "YOUR VALUE"

[job]
max_runtime = <something reasonable>

[sqlite]
````

- run `buildomat-server -f server.toml`. This should start a server process.

- Create a `user.toml` file (this can also live in `~/.config/buildomat/config.toml`
```
[profile.default]
url = "http://127.0.0.1:9979"
secret = "<ADD TOKEN>"
admin = "<ADD TOKEN>"
```
- run `buildomat -p user.toml admin user create admin`. This will spit out an `ADMIN_TOKEN`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw i don't think the token created here is particularly special for admin purposes, it's just a user token. by setting the server's admin.token and client's profile.default.admin to this token, we'll also happen to set that same user token as the administrative key (... and if you were to accidentally delete the admin user then whoops the key's dead)

so, i see how this works, but it's probably better to pick a decent secret administrative token (e.g. dd if=/dev/urandom bs=64 count=1 | base64 -) that is distinct from any user token?

(i also think it might be good to create an admin user with all privileges when setting up the database, whose token is admin.token, then collapsing the distinction between "secret admin token" and "user token". but that's a Josh conversation i'll bring up elsewhere :D)

- Edit `user.toml` to add the token to both `secret` and `admin` (you can create another user later if you so desire!)

- Edit `server.toml` to add the token to the `admin` line

- Create a factory `buildomat admin factory create factory_name` this will
spit out a `FACTORY_TOKEN` which needs to go in a factory TOML file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha, i was wondering what you were doing that you got here but didn't mention factory TOMLs themselves, then i found #52 :)


- Create a target `buildomat admin target create -d "something here" targetname`
this will spit out a `TARGET_TOKEN` which will go in the factory TOML file

This should be enough to run the factory of your choosing and run
`buildomat job run -c your_script.sh -t yourtarget -n jobname`

nginx is available on illumos and easy to setup as a reverse proxy to
redirect requests to your `buildomat-server`
Comment on lines +60 to +61
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm running the server with -b 0.0.0.0:9979 😎 but nginx definitely seems like the thing to get important things like TLS


```
location / {
proxy_pass http://127.0.0.1:9979;
}
```