Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2813653
cleanup
binocarlos Oct 19, 2023
b634637
cleanup frontend build
binocarlos Oct 19, 2023
2c4d6df
add docs and get setup on beefy
binocarlos Oct 19, 2023
4a186a2
job queue
binocarlos Oct 19, 2023
ae0231d
route for task responses
binocarlos Oct 20, 2023
4c8586f
active session map
binocarlos Oct 20, 2023
9762fd5
add docs from luke tutorial on how it all works
binocarlos Oct 20, 2023
bf80f1a
docs
binocarlos Oct 20, 2023
c45786e
temp change to make it easy to iterate
binocarlos Oct 20, 2023
6af1046
remove ssh mount
binocarlos Oct 20, 2023
690c582
docs for dev install of runner
binocarlos Oct 20, 2023
1276eea
ok we need to run the stack locally and have 2 vs code windows
binocarlos Oct 20, 2023
f95bdc3
responses are streaming back to the UI now
binocarlos Oct 20, 2023
5c68f74
add docs for normal sdxl
binocarlos Oct 20, 2023
89a4798
runner scripts that will handle the context switch between mistral an…
binocarlos Oct 20, 2023
326f5d6
image jobs are triggering the runner - now we just need to figure out…
binocarlos Oct 20, 2023
4d97fad
Merge branch 'long-running' of github.com:lukemarsden/helix into long…
binocarlos Oct 20, 2023
4e03e23
assets
lukemarsden Oct 22, 2023
c06a0cb
wip homepage
lukemarsden Oct 22, 2023
32bd973
tweaks
lukemarsden Oct 22, 2023
7d67993
slight improvement
lukemarsden Oct 22, 2023
e32b885
helixification - need to recreate keycloak db
lukemarsden Oct 22, 2023
5ef61b3
tweak styles
lukemarsden Oct 22, 2023
1d0139e
move homepage out and accessible on logged out and logged in state
lukemarsden Oct 22, 2023
1393674
make big
lukemarsden Oct 22, 2023
dbcc8c5
tweaks
lukemarsden Oct 22, 2023
4c2d8a2
tweak
lukemarsden Oct 22, 2023
1364497
wip
lukemarsden Oct 22, 2023
e79b7d8
wip
lukemarsden Oct 23, 2023
f2b7e71
Merge pull request #2 from lukemarsden/website
lukemarsden Oct 23, 2023
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
4 changes: 2 additions & 2 deletions Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ COPY go.mod go.sum ./
RUN go mod download
COPY api ./api
WORKDIR /app/api
RUN go build -o /lilysaas
RUN go build -o /helix
EXPOSE 80
ENTRYPOINT [ "/lilysaas" ]
ENTRYPOINT [ "/helix" ]
127 changes: 2 additions & 125 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,3 @@
# lilysaas
# helix

* what are the core database schema "things"
* what is the plan for taking payments?
* what are the key actions?

## entities

* auth
* use keycloak
* model
* json file to start with
* a list of things that lilypad can run
* job
* inference
* training (fine tunings)
* starts with an existing model
* produces a new model

## plan

This is to have a hello world that you can login to.

* docker compose stack
* keycloak
* frontend (react & vite)
* api (go)
* postgres


## dev

You need the following installed:

* docker
* docker-compose
* [abigen](https://geth.ethereum.org/docs/getting-started/installing-geth)
* [bacalhau](https://github.com/bacalhau-project/lilypad/blob/fe9999b96d0920083ab3b1c4dbe4c647c5db36d3/CONTRIBUTING.md#bacalhau)

You also need the lilypad repo cloned alongside this one.

### smart contract interface

When the smart contract in lilypad changes - checkout latest main of lilypad and then:

```bash
./stack generate-golang-bindings
```

This will re-create the `api/pkg/contract/Modicum.go`

## running alongside lilypad in local dev

Make sure that you have cloned [lilypad](https://github.com/bacalhau-project/lilypad) at the same level as this repo.

```bash
export RUN_LILYPAD=1
./stack start
```

This will boot a fresh lilypad and lilysaas stack and link everything together using tmux.

To run each part manually here are the guides:

#### lilypad

First start lilypad and then bacalhau:

```bash
cd lilypad
./stack boot
```

Then we start bacalhau:

**NOTE** you will require the correct version of bacalhau - run through [this guide](https://github.com/bacalhau-project/lilypad/blob/fe9999b96d0920083ab3b1c4dbe4c647c5db36d3/CONTRIBUTING.md#bacalhau):

```bash
./stack bacalhau-serve
```

Now we need 3 other terminals each with `LOG_LEVEL=debug`

```bash
./stack solver --server-url http://172.17.0.1:8080
```

so it reports an address accessible from inside docker (the default docker bridge ip - this will probably only work on linux? on mac maybe you can use `host.docker.internal`)


```bash
./stack mediator
```

```bash
./stack resource-provider
```

Now we switch to lilysaas and get it booted alongside lilypad.

#### lilysaas

We need to create an top level `.env` file like so

```
export WEB3_PRIVATE_KEY=XXX
```

You can get the WEB3_PRIVATE_KEY value with this command:

```bash
cat ../lilypad/.env | grep JOB_CREATOR_PRIVATE_KEY
```

Copy the value of this to be the `WEB3_PRIVATE_KEY` value in the `.env` file - the other values should be as shown.

```bash
docker-compose up -d
```

Then we exec into the api container and run the api server:

```bash
docker-compose exec api bash
go run . serve
```
Your own ChatGPT as a service.
6 changes: 3 additions & 3 deletions api/cmd/lilysaas/root.go → api/cmd/helix/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lilysaas
package helix

import (
"context"
Expand All @@ -16,8 +16,8 @@ func init() { //nolint:gochecknoinits
func NewRootCmd() *cobra.Command {
RootCmd := &cobra.Command{
Use: getCommandLineExecutable(),
Short: "LilySaaS",
Long: `LilySaaS`,
Short: "Helix",
Long: `Helix`,
}
RootCmd.AddCommand(newServeCmd())
return RootCmd
Expand Down
29 changes: 11 additions & 18 deletions api/cmd/lilysaas/serve.go → api/cmd/helix/serve.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lilysaas
package helix

import (
"context"
Expand All @@ -8,12 +8,11 @@ import (
"os/signal"
"path/filepath"

"github.com/bacalhau-project/lilysaas/api/pkg/controller"
"github.com/bacalhau-project/lilysaas/api/pkg/filestore"
"github.com/bacalhau-project/lilysaas/api/pkg/job"
"github.com/bacalhau-project/lilysaas/api/pkg/server"
"github.com/bacalhau-project/lilysaas/api/pkg/store"
"github.com/bacalhau-project/lilysaas/api/pkg/system"
"github.com/lukemarsden/helix/api/pkg/controller"
"github.com/lukemarsden/helix/api/pkg/filestore"
"github.com/lukemarsden/helix/api/pkg/server"
"github.com/lukemarsden/helix/api/pkg/store"
"github.com/lukemarsden/helix/api/pkg/system"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
Expand All @@ -35,15 +34,15 @@ func NewAllOptions() *AllOptions {
},
FilestoreOptions: filestore.FileStoreOptions{
Type: filestore.FileStoreType(getDefaultServeOptionString("FILESTORE_TYPE", "fs")),
LocalFSPath: getDefaultServeOptionString("FILESTORE_LOCALFS_PATH", "/tmp/lilysaas/filestore"),
LocalFSPath: getDefaultServeOptionString("FILESTORE_LOCALFS_PATH", "/tmp/helix/filestore"),
GCSKeyBase64: getDefaultServeOptionString("FILESTORE_GCS_KEY_BASE64", ""),
GCSKeyFile: getDefaultServeOptionString("FILESTORE_GCS_KEY_FILE", ""),
GCSBucket: getDefaultServeOptionString("FILESTORE_GCS_BUCKET", ""),
},
StoreOptions: store.StoreOptions{
Host: getDefaultServeOptionString("POSTGRES_HOST", ""),
Port: getDefaultServeOptionInt("POSTGRES_PORT", 5432),
Database: getDefaultServeOptionString("POSTGRES_DATABASE", "lilysaas"),
Database: getDefaultServeOptionString("POSTGRES_DATABASE", "helix"),
Username: getDefaultServeOptionString("POSTGRES_USER", ""),
Password: getDefaultServeOptionString("POSTGRES_PASSWORD", ""),
AutoMigrate: true,
Expand All @@ -63,8 +62,8 @@ func newServeCmd() *cobra.Command {

serveCmd := &cobra.Command{
Use: "serve",
Short: "Start the lilysaas api server.",
Long: "Start the lilysaas api server.",
Short: "Start the helix api server.",
Long: "Start the helix api server.",
Example: "TBD",
RunE: func(cmd *cobra.Command, _ []string) error {
return serve(cmd, allOptions)
Expand Down Expand Up @@ -245,19 +244,13 @@ func serve(cmd *cobra.Command, options *AllOptions) error {
return err
}

jobRunner, err := job.NewJobRunner(ctx)
if err != nil {
return err
}

store, err := store.NewPostgresStore(options.StoreOptions)
if err != nil {
return err
}

options.ControllerOptions.Store = store
options.ControllerOptions.Filestore = fs
options.ControllerOptions.JobRunner = jobRunner

if options.FilestoreOptions.Type == filestore.FileStoreTypeLocalFS {
options.ServerOptions.LocalFilestorePath = options.FilestoreOptions.LocalFSPath
Expand All @@ -278,7 +271,7 @@ func serve(cmd *cobra.Command, options *AllOptions) error {
return err
}

log.Info().Msgf("LilySaaS server listening on %s:%d", options.ServerOptions.Host, options.ServerOptions.Port)
log.Info().Msgf("Helix server listening on %s:%d", options.ServerOptions.Host, options.ServerOptions.Port)

go func() {
err := server.ListenAndServe(ctx, cm)
Expand Down
2 changes: 1 addition & 1 deletion api/cmd/lilysaas/utils.go → api/cmd/helix/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lilysaas
package helix

import (
"os"
Expand Down
4 changes: 2 additions & 2 deletions api/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
"github.com/bacalhau-project/lilysaas/api/cmd/lilysaas"
"github.com/joho/godotenv"
"github.com/lukemarsden/helix/api/cmd/helix"
)

func main() {
_ = godotenv.Load()
lilysaas.Execute()
helix.Execute()
}
Loading