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

WIP: Add more fields to tasks #7

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
140 changes: 130 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Vicky

Vicky consists of three services:
- Vicky itself
- Dashboard (The frontend)
- Vicky runner

## Dev Environment

### Requirements

For a dev environment we need the following services:
- S3 endpoint
- OIDC endpoint
- etcd

There is a Dockerfile and a nix based devenv supplied to run those.

For vicky itself we ship a nix flake that provides all the dependencies.

### Dashboard

```
cd dashboard
npm start
```

Now the frontend listens at `http://localhost:1234/tasks`

### Vicky

Example Rocket.toml for **dev environments**:
```toml
[default]

machines = [
"abc1234"
]

[default.etcd_config]
endpoints = [ "http://localhost:2379" ]

[default.s3_config]
endpoint = "http://localhost:9000"
access_key_id = "minio"
secret_access_key = "aichudiKohr6aithi4ahh3aeng2eL7xo"
region = "us-east-1"
log_bucket = "vicky-logs"

[default.oauth.github]
provider = "GitHub"
client_id = "CHANGEME"
client_secret = "CHANGEME"
redirect_uri = "http://localhost:1234/api/auth/callback/github"


[default.users.sdinkleberg]
full_name = "Sheldon Dinkleberg"
role = "admin"
```

Now you can start the service running:
```
cargo run --bin vicky
```

## Create a task

Tasks always have a display name and a `flake_ref`.
The `flake_ref` is a reference to a Nix flake that runs the code.

Example request:
```
curl -s --request POST \
--url http://127.0.0.1:1234/api/tasks/ \
--header "Authorization: abc1234" \
--header 'Content-Type: application/json' \
--data '{
"display_name": "ExampleTask Turn on coffee machine",
"locks": [],
"flake_ref": {
"flake": "github:wobcom/cosmo#generate-certs",
"args": []
}
}'
```


36 changes: 36 additions & 0 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"author": "Johann Wagner <johann.wagner@wobcom>",
"license": "MIT",
"dependencies": {
"@fortawesome/free-regular-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@rsuite/icons": "^1.0.3",
"@uidotdev/usehooks": "^2.4.1",
"axios": "^1.5.0",
"parcel": "^2.9.3",
Expand Down
Loading
Loading