Skip to content

Commit 8ea8e02

Browse files
committed
change user facing names
1 parent afb3b89 commit 8ea8e02

19 files changed

+2260
-99
lines changed

Dockerfile.api

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM golang:1.20-alpine
2+
WORKDIR /app
3+
RUN apk add --no-cache bash
4+
COPY go.mod go.sum ./
5+
RUN go mod download
6+
COPY cmd ./cmd
7+
COPY pkg ./pkg
8+
COPY main.go .
9+
WORKDIR /app
10+
RUN go build -o /gdcn
11+
EXPOSE 80
12+
ENTRYPOINT [ "/gdcn" ]

README.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ wget https://github.com/bacalhau-project/bacalhau/releases/download/v1.0.3/bacal
115115
tar xfv bacalhau_v1.0.3_linux_amd64.tar.gz
116116
mv bacalhau /usr/local/bin
117117
# Set the IPFS data path by exporting the `BACALHAU_SERVE_IPFS_PATH` variable to your desired location
118-
export BACALHAU_SERVE_IPFS_PATH=/tmp/lilypad/data/ipfs
118+
export BACALHAU_SERVE_IPFS_PATH=/tmp/gdcn/data/ipfs
119119
```
120120

121121
#### clone faucet repo
@@ -175,6 +175,12 @@ Run the following commands in separate terminal windows:
175175
./stack solver
176176
```
177177

178+
**NOTE** if you want to run the SAAS layer then we need to run the solver on the docker bridge as follows:
179+
180+
```bash
181+
./stack solver --server-url http://172.17.0.1:8080
182+
```
183+
178184
#### mediator
179185

180186
Wait for the solver to start when `🟡 SOL solver registered` is logged, and then, in another terminal window, run:
@@ -213,6 +219,25 @@ Otherwise, if you don't have a GPU:
213219
./stack resource-provider
214220
```
215221

222+
### run saas
223+
224+
The generic-dcn repo also comes with a saas layer that can be used as a web2 layer to the underlying web3 stack.
225+
226+
The api will run using a `WEB3_PRIVATE_KEY` and essentially act as a job creator on behalf of registered users.
227+
228+
This means you can open up your decentralized compute network to a wider audience who might not have access to metamask or other web3 tools.
229+
230+
Once the core network is up and running as described above, you can run the saas layer as follows:
231+
232+
**NOTE** it's important that you started the solver using the `./stack solver --server-url http://172.17.0.1:8080` command as described above.
233+
234+
```bash
235+
docker-compose build
236+
docker-compose up -d
237+
```
238+
239+
Now you should be able to access the saas layer using http://localhost
240+
216241
### run faucet
217242

218243
To run the faucet container so you can test with other user accounts:
@@ -447,6 +472,18 @@ You can now start and stop the various services using `systemd` and see logs usi
447472

448473
Make sure you start the solver first.
449474

475+
### running the saas layer
476+
477+
To run the saas layer in production it's important to use another machine than the solver so the saas api can speak to the solver using it's public http(s) endpoint.
478+
479+
To run the various services there are a few options:
480+
481+
* use the `docker-compose.yaml` file but change some values
482+
* run the various services using another tool like k8s (they are all docker based services)
483+
* run the various services using systemd
484+
485+
We have left this choice to the reader as it depends on the environment you are deploying to.
486+
450487
## troubleshooting
451488

452489
### receive buffer size error

cmd/gdcn/jobcreator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ func newJobCreatorCmd() *cobra.Command {
1313

1414
solverCmd := &cobra.Command{
1515
Use: "jobcreator",
16-
Short: "Start the lilypad job creator service.",
17-
Long: "Start the lilypad job creator service.",
16+
Short: "Start the gdcn job creator service.",
17+
Long: "Start the gdcn job creator service.",
1818
Example: "",
1919
RunE: func(cmd *cobra.Command, args []string) error {
2020
options, err := optionsfactory.ProcessOnChainJobCreatorOptions(options, args)

cmd/gdcn/mediator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ func newMediatorCmd() *cobra.Command {
1515

1616
mediatorCmd := &cobra.Command{
1717
Use: "mediator",
18-
Short: "Start the lilypad mediator service.",
19-
Long: "Start the lilypad mediator service.",
18+
Short: "Start the gdcn mediator service.",
19+
Long: "Start the gdcn mediator service.",
2020
Example: "",
2121
RunE: func(cmd *cobra.Command, _ []string) error {
2222
options, err := optionsfactory.ProcessMediatorOptions(options)

cmd/gdcn/resource-provider.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ func newResourceProviderCmd() *cobra.Command {
1414

1515
resourceProviderCmd := &cobra.Command{
1616
Use: "resource-provider",
17-
Short: "Start the lilypad resource-provider service.",
18-
Long: "Start the lilypad resource-provider service.",
17+
Short: "Start the gdcn resource-provider service.",
18+
Long: "Start the gdcn resource-provider service.",
1919
Example: "",
2020
RunE: func(cmd *cobra.Command, _ []string) error {
2121
options, err := optionsfactory.ProcessResourceProviderOptions(options)

cmd/gdcn/root.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ func init() { //nolint:gochecknoinits
1616
func NewRootCmd() *cobra.Command {
1717
RootCmd := &cobra.Command{
1818
Use: getCommandLineExecutable(),
19-
Short: "Lilypad",
20-
Long: `Lilypad`,
19+
Short: "Generic Decentralized Compute Network",
20+
Long: `Generic Decentralized Compute Network`,
2121
}
2222
RootCmd.AddCommand(newSolverCmd())
2323
RootCmd.AddCommand(newResourceProviderCmd())
2424
RootCmd.AddCommand(newRunCmd())
2525
RootCmd.AddCommand(newMediatorCmd())
2626
RootCmd.AddCommand(newJobCreatorCmd())
27-
RootCmd.AddCommand(newVersionCmd())
27+
RootCmd.AddCommand(newSaasApiCmd())
2828
return RootCmd
2929
}
3030

cmd/gdcn/run.go

+5-14
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func newRunCmd() *cobra.Command {
2222
options := optionsfactory.NewJobCreatorOptions()
2323
runCmd := &cobra.Command{
2424
Use: "run",
25-
Short: "Run a job on the Lilypad network.",
26-
Long: "Run a job on the Lilypad network.",
25+
Short: "Run a job on the Generic Decentralized Compute network.",
26+
Long: "Run a job on the Generic Decentralized Compute network.",
2727
Example: "run cowsay:v0.0.1 -i Message=moo",
2828
RunE: func(cmd *cobra.Command, args []string) error {
2929
options, err := optionsfactory.ProcessJobCreatorOptions(options, args)
@@ -42,18 +42,9 @@ func newRunCmd() *cobra.Command {
4242
func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions) error {
4343
c := color.New(color.FgCyan).Add(color.Bold)
4444
c.Print(`
45-
⠀⠀⠀⠀⠀⠀⣀⣤⣤⢠⣤⣀⠀⠀⠀⠀⠀
46-
⠀⠀⠀⠀⢴⣿⣿⣿⣿⢸⣿⡟⠀⠀⠀⠀⠀ ██╗ ██╗██╗ ██╗ ██╗██████╗ █████╗ ██████╗
47-
⠀⠀⣰⣿⣦⡙⢿⣿⣿⢸⡿⠀⠀⠀⠀⢀⠀ ██║ ██║██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
48-
⠀⢰⣿⣿⣿⣿⣦⡙⣿⢸⠁⢀⣠⣴⣾⣿⡆ ██║ ██║██║ ╚████╔╝ ██████╔╝███████║██║ ██║
49-
⠀⣛⣛⣛⣛⣛⣛⣛⠈⠀⣚⣛⣛⣛⣛⣛⣛ ██║ ██║██║ ╚██╔╝ ██╔═══╝ ██╔══██║██║ ██║
50-
⠀⢹⣿⣿⣿⣿⠟⣡⣿⢸⣮⡻⣿⣿⣿⣿⡏ ███████╗██║███████╗██║ ██║ ██║ ██║██████╔╝
51-
⠀⠀⢻⣿⡟⣩⣾⣿⣿⢸⣿⣿⣌⠻⣿⡟⠀ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ v2
52-
⠀⠀⠀⠉⢾⣿⣿⣿⣿⢸⣿⣿⣿⡷⠈⠀⠀
53-
⠀⠀⠀⠀⠀⠈⠙⠛⠛⠘⠛⠋⠁⠀ ⠀⠀⠀ Decentralized Compute Network https://lilypad.tech
54-
45+
Generic Decentralized Compute Network https://github.com/bacalhau-project/generic-dcn
5546
`)
56-
spinner, err := createSpinner("Lilypad submitting job", "🌟")
47+
spinner, err := createSpinner("Generic Decentralized Compute Network submitting job", "🌟")
5748
if err != nil {
5849
fmt.Printf("failed to make spinner from config struct: %v\n", err)
5950
os.Exit(1)
@@ -133,7 +124,7 @@ func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions) error {
133124
return err
134125
}
135126
spinner.Stop()
136-
fmt.Printf("\n🍂 Lilypad job completed, try 👇\n open %s\n cat %s/stdout\n cat %s/stderr\n https://ipfs.io/ipfs/%s\n",
127+
fmt.Printf("\n🍂 Generic Decentralized Compute Network job completed, try 👇\n open %s\n cat %s/stdout\n cat %s/stderr\n https://ipfs.io/ipfs/%s\n",
137128
solver.GetDownloadsFilePath(result.JobOffer.DealID),
138129
solver.GetDownloadsFilePath(result.JobOffer.DealID),
139130
solver.GetDownloadsFilePath(result.JobOffer.DealID),

cmd/gdcn/saas-api.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ func NewAllOptions() *AllOptions {
5858
}
5959
}
6060

61-
func newServeCmd() *cobra.Command {
61+
func newSaasApiCmd() *cobra.Command {
6262
allOptions := NewAllOptions()
6363

6464
serveCmd := &cobra.Command{
65-
Use: "serve",
65+
Use: "saas-api",
6666
Short: "Start the lilysaas api server.",
6767
Long: "Start the lilysaas api server.",
6868
Example: "TBD",

cmd/gdcn/solver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ func newSolverCmd() *cobra.Command {
1414

1515
solverCmd := &cobra.Command{
1616
Use: "solver",
17-
Short: "Start the lilypad solver service.",
18-
Long: "Start the lilypad solver service.",
17+
Short: "Start the Generic Decentralized Compute Network solver service.",
18+
Long: "Start the Generic Decentralized Compute Network solver service.",
1919
Example: "",
2020
RunE: func(cmd *cobra.Command, _ []string) error {
2121
options, err := optionsfactory.ProcessSolverOptions(options)

cmd/gdcn/version.go

-52
This file was deleted.

docker-compose.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ services:
6161
context: .
6262
dockerfile: Dockerfile.api
6363
restart: always
64-
env_file: .env
6564
environment:
6665
- LOG_LEVEL=debug
6766
- APP_URL=${SERVER_URL:-http://localhost}
@@ -79,11 +78,12 @@ services:
7978
- WEB3_CONTROLLER_ADDRESS=${WEB3_CONTROLLER_ADDRESS-0x59b670e9fA9D0A427751Af201D676719a970857b}
8079
# this is an insecure development key - do not use in production!
8180
- KEYCLOAK_TOKEN=${KEYCLOAK_TOKEN-5ca0fc03-d625-456e-bca7-8e732309165f}
82-
entrypoint: ${API_ENTRYPOINT:-tail -f /dev/null}
81+
entrypoint: ${API_ENTRYPOINT:-go run . saas-api}
8382
volumes:
8483
- ./go.mod:/app/go.mod
8584
- ./go.sum:/app/go.sum
86-
- ./api:/app/api
85+
- ./cmd:/app/cmd
86+
- ./pkg:/app/pkg
8787
gradio:
8888
ports:
8989
- 7860:7860

docs/images/saas.png

1.01 MB
Loading

frontend/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<meta
77
name="description"
8-
content="Lilypad AI Studio"
8+
content="Generic Decentralized Compute Network AI Studio"
99
/>
1010
<link rel="icon" href="/img/logo.png">
1111
<link
@@ -18,7 +18,7 @@
1818
href="https://fonts.googleapis.com/icon?family=Material+Icons"
1919
/>
2020
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/file-icon-vivid.min.css" />
21-
<title>Lilypad AI Studio</title>
21+
<title>Generic Decentralized Compute Network AI Studio</title>
2222
</head>
2323
<body>
2424
<noscript>You need to enable JavaScript to run this app.</noscript>

frontend/src/themes.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { ReactElement } from 'react'
22
import Box from '@mui/material/Box'
33
import Typography from '@mui/material/Typography'
44

5-
const DEFAULT_THEME_NAME = 'lilypad'
5+
const DEFAULT_THEME_NAME = 'gdcn'
66

77
export interface ITheme {
88
company: string,
@@ -16,9 +16,9 @@ export interface ITheme {
1616
}
1717

1818
export const THEMES: Record<string, ITheme> = {
19-
lilypad: {
20-
company: 'Lilypad',
21-
url: 'https://lilypad.tech/',
19+
gdcn: {
20+
company: 'Generic Decentralized Compute Network',
21+
url: 'https://github.com/bacalhau-project/generic-dcn',
2222
primary: '#14c7c3',
2323
secondary: '#fec284',
2424
activeSections: [],
@@ -31,7 +31,7 @@ export const THEMES: Record<string, ITheme> = {
3131
<Box
3232
component="img"
3333
src="/img/logo.png"
34-
alt="Lilypad"
34+
alt="Generic Decentralized Compute Network"
3535
sx={{
3636
height: 30,
3737
ml: 1,
@@ -41,15 +41,16 @@ export const THEMES: Record<string, ITheme> = {
4141
ml: 2,
4242
mr: 1,
4343
}}>
44-
Lilypad AI Studio
44+
Generic Decentralized Compute Network AI Studio
4545
</Typography>
4646
</Box>
4747
),
4848
},
4949
}
5050

51+
// if you want to use different themes for different domains then put them here:
5152
export const THEME_DOMAINS: Record<string, string> = {
52-
'lilypad.tech': 'lilypad',
53+
5354
}
5455

5556

5.2 KB
Binary file not shown.

hardhat/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "lilypad",
2+
"name": "gdcn",
33
"version": "0.0.1",
44
"license": "Apache-2.0",
55
"scripts": {},

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ func main() {
1111
}
1212

1313
func init() {
14-
fmt.Printf("Lilypad: %s\n", gdcn.VERSION)
14+
fmt.Printf("GDCN\n")
1515
}

0 commit comments

Comments
 (0)