You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+99-72Lines changed: 99 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,23 +29,24 @@
29
29
</p>
30
30
</div>
31
31
32
-
[Gooey.AI](http://gooey.ai/) is the low-code orchestration platform with **discoverable workflows** & **unified billing to all of GenAI universe.**
33
-
34
-
32
+
[Gooey.AI](http://gooey.ai/) is the low-code orchestration platform with **discoverable workflows** & **unified billing to all of GenAI universe.**
35
33
36
34
# 🤖🍲 What is Gooey Server?
37
-
Gooey.AI is a low-code AI recipe platform and Gooey Server is our core repo.
35
+
36
+
Gooey.AI is a low-code AI recipe platform and Gooey Server is our core repo.
38
37
It allows users to discover, customize, and deploy AI "recipes" using the best of private and open-source AI,
39
-
all using a single API with a single auth token.
40
-
Recipes are workflows that incorporate various models to accomplish a task; they are designed to be highly customizable and shareable.
38
+
all using a single API with a single auth token.
39
+
Recipes are workflows that incorporate various models to accomplish a task; they are designed to be highly customizable and shareable.
41
40
42
41
## 🧑💻 Who is this for and why would I want to use it?
43
-
For most developers, we DO NOT recommend running or forking Gooey Server; use our [APIs](https://gooey.ai/api/) or [client SDK](https://github.com/GooeyAI/python-sdk) instead.
44
-
The repo is intended only for developers who want to run and deploy their own server cluster or run Gooey locally for development purposes.
42
+
43
+
For most developers, we DO NOT recommend running or forking Gooey Server; use our [APIs](https://gooey.ai/api/) or [client SDK](https://github.com/GooeyAI/python-sdk) instead.
44
+
The repo is intended only for developers who want to run and deploy their own server cluster or run Gooey locally for development purposes.
45
45
46
46
Specifically, this repo may be for you if:
47
+
47
48
- You want to create a new recipe (instead of changing the parameters on an existing one)
48
-
- You want to add an AI model that we currently don’t support.
49
+
- You want to add an AI model that we currently don’t support.
49
50
- You are an enterprise with specific requirements regarding data practices, such as using specific cloud providers.
50
51
- You want to add some other functionality that we don’t support.
51
52
@@ -54,7 +55,7 @@ Specifically, this repo may be for you if:
54
55
### ☁️ Create a google cloud / firebase account
55
56
56
57
1. Create a [google cloud](https://console.cloud.google.com/) project
57
-
2. Create a [firebase project](https://console.firebase.google.com/) (using the same google cloud project)
58
+
2. Create a [firebase project](https://console.firebase.google.com/) (using the same google cloud project)
* Enable background services for `redis`, `rabbitmq`, and `postgresql` (e.g. with `brew services start redis` and similar for `rabbitmq` and `postgresql`)
85
-
* Use `sqlcreate` helper to create a user and database for gooey:
86
-
*`./manage.py sqlcreate | psql postgres`
87
-
* make sure you are able to access the database with `psql -W -U gooey gooey` (and when prompted for password, entering `gooey`)
88
-
* Create an `.env` file from `.env.example` (Read [12factor.net/config](https://12factor.net/config))
89
-
* Run `./manage.py migrate`
90
-
* Install the zbar library (`brew install zbar`)
91
-
* (optional) Install imagemagick - Needed for HEIC image support - https://docs.wand-py.org/en/0.5.7/guide/install.html
78
+
- Install [pyenv](https://github.com/pyenv/pyenv) & install the same python version as in our [Dockerfile](Dockerfile)
- Enable background services for `redis`, `rabbitmq`, and `postgresql` (e.g. with `brew services start redis` and similar for `rabbitmq` and `postgresql`)
85
+
- Use `sqlcreate` helper to create a user and database for gooey:
86
+
-`./manage.py sqlcreate | psql postgres`
87
+
- make sure you are able to access the database with `psql -W -U gooey gooey` (and when prompted for password, entering `gooey`)
88
+
- Create an `.env` file from `.env.example` (Read [12factor.net/config](https://12factor.net/config))
89
+
- Run `./manage.py migrate`
90
+
- Install the zbar library (`brew install zbar`)
91
+
- (optional) Install imagemagick - Needed for HEIC image support - https://docs.wand-py.org/en/0.5.7/guide/install.html
92
+
92
93
```
93
94
brew install freetype imagemagick
94
95
export MAGICK_HOME=/opt/homebrew
95
96
```
96
97
97
98
### 🐧 Setup (Linux)
98
-
* Install [pyenv](https://github.com/pyenv/pyenv) & install the same python version as in our [Dockerfile](Dockerfile) (currently Python 3.10)
99
+
100
+
- Install [pyenv](https://github.com/pyenv/pyenv) & install the same python version as in our [Dockerfile](Dockerfile) (currently Python 3.10)
- This is likely available in your distro's package repos.
104
+
- Clone this repository:
105
+
- Create and activate a virtualenv using `poetry shell`
106
+
- Install dependencies using `poetry install --with dev`
105
107
- Note: you may have to remove `package-mode=false` on line 7 of `pyproject.toml`
106
-
* Install redis, rabbitmq-server, and postgresql 15 using your distro's package manager.
107
-
* Enable these services as background services using `sudo systemctl enable --now redis rabbitmq-server postgresql`
108
-
* Configure Postgres to ensure that password authentication is enabled for the gooey user
109
-
- open the pg_hba.conf file in a text editor. On Linux, by default, it is usually located either at ```/etc/postgresql/<version>/main/``` or ```/var/lib/pgsql/<version>/data/```
110
-
- add/edit the file so that there are lines at the bottom that looks like this:
111
-
```
112
-
local all gooey md5
113
-
host all gooey md5
114
-
```
115
-
- restart postgresql using ```sudo systemctl restart postgresql```
116
-
* Use the manage.py script to set up the Postgres database:
108
+
- Install redis, rabbitmq-server, and postgresql 15 using your distro's package manager.
109
+
- Enable these services as background services using `sudo systemctl enable --now redis rabbitmq-server postgresql`
110
+
- Configure Postgres to ensure that password authentication is enabled for the gooey user
111
+
- open the pg_hba.conf file in a text editor. On Linux, by default, it is usually located either at `/etc/postgresql/<version>/main/` or `/var/lib/pgsql/<version>/data/`
112
+
- add/edit the file so that there are lines at the bottom that looks like this:
113
+
```
114
+
local all gooey md5
115
+
host all gooey md5
116
+
```
117
+
- restart postgresql using `sudo systemctl restart postgresql`
118
+
- Use the manage.py script to set up the Postgres database:
117
119
- To create the user and database for gooey: `./manage.py sqlcreate | sudo -u postgres psql postgres `
118
120
- Test your setup to ensure that `gooey-server` can access the database by running `psql -W -U gooey gooey` and supplying "gooey" as the password
119
-
* Create a .env file from `.env.example`
120
-
* Install the zbar library using your distro's package manager.
121
+
- Create a .env file from `.env.example`
122
+
- Install the zbar library using your distro's package manager.
121
123
122
-
### 🌍 Frontend
124
+
### 🌍 Frontend
123
125
124
126
Clone [gooey-gui](https://github.com/GooeyAI/gooey-gui) repo, in the same directory as `gooey-server` and follow the setup steps.
125
127
126
128
### 🧪 Run Tests
127
129
128
-
```
130
+
```
129
131
ulimit -n unlimited # Increase the number of open files allowed
130
132
./scripts/run-tests.sh
131
133
```
132
134
133
135
### 🗄 Initialize databse
134
136
135
-
136
137
```bash
137
138
# reset the database
138
139
./manage.py reset_db -c
@@ -146,70 +147,96 @@ ulimit -n unlimited # Increase the number of open files allowed
146
147
./manage.py createsuperuser
147
148
```
148
149
150
+
## 📐 Code Formatting
151
+
152
+
Use [ruff](https://docs.astral.sh/ruff/)
153
+
149
154
## 🏃 Run
150
155
151
-
_Note: The `gooey-server` project is not currently set up to be run without support from Gooey. This software requires access to a Google Cloud instance as well as business data loaded in the database. If you are interested in running this software totally independently, reach out to [email protected] to communicate with our enterprise team._
156
+
_Note: The `gooey-server` project is not currently set up to be run without support from Gooey. This software requires access to a Google Cloud instance as well as business data loaded in the database. If you are interested in running this software totally independently, reach out to [email protected] to communicate with our enterprise team._
152
157
153
158
### Services
154
159
155
-
The processes that it starts are defined in [`Procfile`](Procfile).
156
-
Currently they are these:
160
+
These are the services that you need to run to start developing locally. Open them in separate terminals so you can debug them individually.
This default startup assumes that Redis, RabbitMQ, and PostgreSQL are installed and running
171
+
as background services on ports `6379`, `5672`, and `5432` respectively.
168
172
169
-
You can start all required processes in one command with Honcho:
173
+
The gooey-gui repo should be cloned at `../gooey-gui/`
174
+
(adjacent to where the`gooey-server` repo sits).
175
+
176
+
### Reloading on code changes
177
+
178
+
- The Python API + GUI Server should reload the entire server on code changes. You can refresh the page to see the changes.
179
+
180
+
- The Celery worker must be manually restarted on code changes.
181
+
182
+
- If you are working on the gooey-gui (react frontend), you can run:
170
183
171
184
```shell
172
-
poetry run honcho start
185
+
cd ../gooey-gui/; PORT=3000 REDIS_URL=redis://localhost:6379 npm run dev
173
186
```
174
-
This will spin up the API server at `http://localhost:8080`. To view the autogenerated API documentation, navigate to `http://localhost:8080/docs`
175
187
176
-
This default startup assumes that Redis, RabbitMQ, and PostgreSQL are installed and running
177
-
as background services on ports `6379`, `5672`, and `5432` respectively.
188
+
#### Hot Reloading
178
189
179
-
The gooey-gui repo should be cloned at `../gooey-gui/`
180
-
(adjacent to where the`gooey-server` repo sits). You can open the Procfile and comment this out if you don't need
181
-
to run it.
190
+
If you run this command, the Python API + GUI Server will reload the webpage in-place on code changes.
182
191
183
-
**Note:** the Celery worker must be manually restarted on code changes. You
184
-
can do this by stopping and starting Honcho.
192
+
```shell
193
+
poetry run python server.py
194
+
```
195
+
196
+
This mostly works, but consumes more memory and usually OOMs after a few reloads; YMMV. Use it to iterate quickly on UI changes!
185
197
186
198
### Vespa (used for vector search)
187
199
188
200
You need to install OrbStack or Docker Desktop for this to work.
189
201
190
202
1. Create a persistent volume for Vespa:
203
+
191
204
```bash
192
205
docker volume create vespa
193
206
```
207
+
194
208
2. Run the container:
209
+
195
210
```bash
196
211
docker run \
197
212
--hostname vespa-container \
198
213
-p 8085:8080 -p 19071:19071 \
199
214
--volume vespa:/opt/vespa/var \
200
215
-it --rm --name vespa vespaengine/vespa
201
216
```
217
+
202
218
3. Run the setup script
219
+
203
220
```bash
204
221
./manage.py runscript setup_vespa_db
205
222
```
206
223
224
+
### Honcho
207
225
208
-
### 📐 Code Formatting
226
+
> [!CAUTION]
227
+
> This method is not recommended as this makes it harder to debug individual services but it is the easiest way to start all services at once.
209
228
210
-
Use [ruff](https://docs.astral.sh/ruff/)
229
+
You can start all required processes in one command with Honcho:
230
+
231
+
```shell
232
+
poetry run honcho start
233
+
```
234
+
235
+
The processes that it starts are defined in [`Procfile`](Procfile). You can open the Procfile and comment out any services you don't need to run.
236
+
237
+
This will spin up the API server at `http://localhost:8080`. To view the autogenerated API documentation, navigate to `http://localhost:8080/docs`
211
238
212
-
###💣 Secret Scanning
239
+
## 💣 Secret Scanning
213
240
214
241
Gitleaks will automatically run pre-commit (see `pre-commit-config.yaml` for details) to prevent commits with secrets in the first place. To test this without committing, run `pre-commit` from the terminal. To skip this check, use `SKIP=gitleaks git commit -m "message"` to commit changes. Preferably, label false positives with the `#gitleaks:allow` comment instead of skipping the check.
0 commit comments