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

Just a notification on external changes #85

Open
wants to merge 254 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
35bee7a
output error messages with Syntax highlighting
dasmy Jul 26, 2023
e01f465
create individual workdir for kernel and initialize a dedicated virtu…
dasmy Jul 27, 2023
7a82c76
fix up-/download by using a fixed workspace name. this is fine as lon…
dasmy Jul 27, 2023
7336b80
some PEP8 and code deduplication
dasmy Jul 27, 2023
b9b1b71
Merge pull request #13 from dasmy/dev/more_icons
dasmy Jul 28, 2023
05d85f6
Merge pull request #14 from dasmy/dev/do_not_execute_without_code
dasmy Jul 28, 2023
54fc5cf
Merge branch 'main' into dev/kernel_env
dasmy Jul 28, 2023
5f75280
Merge pull request #15 from dasmy/dev/kernel_env
dasmy Jul 28, 2023
5b6b4d5
Merge branch 'main' into dev/conversation_history
dasmy Jul 28, 2023
bbe1069
Merge pull request #16 from dasmy/dev/conversation_history
dasmy Jul 28, 2023
6c5a4c6
create individual workdir for kernel and initialize a dedicated virtu…
dasmy Jul 27, 2023
248c3cc
fix up-/download by using a fixed workspace name. this is fine as lon…
dasmy Jul 27, 2023
702365b
some PEP8 and code deduplication
dasmy Jul 27, 2023
302464a
make creation of new env optional
dasmy Jul 31, 2023
e332116
make virtual env creation much faster
dasmy Jul 31, 2023
61f67bb
Merge branch 'dev/kernel_env'
dasmy Jul 31, 2023
59ade6a
support image output generated with Draw.MolToImage(caffeine_molecule…
dasmy Aug 1, 2023
4259f96
make sure that message_status messages are actually shown
dasmy Aug 3, 2023
416f4c2
truncate entries in the history to avoid overrunning it too quickly w…
dasmy Aug 3, 2023
21d367e
Distinguish User and Computer prompts.
dasmy Aug 3, 2023
26cbaa4
fix prompt that got lost during merging
dasmy Aug 3, 2023
40a5da6
activate encryption in app
dasmy Aug 3, 2023
f0068e9
create session_id, use it in interaction with kernel backend. This br…
dasmy Aug 3, 2023
7810f85
run one individual kernel per session
dasmy Aug 3, 2023
574ca1e
move string constant into config module
dasmy Aug 3, 2023
ec6c8e4
query workdir from kernel manager instead of constructing it by ourse…
dasmy Aug 3, 2023
3805420
Initial config for AppService deployment
dasmy Aug 7, 2023
6bc9ee5
use env settings from APP_SERVICE_CONFIG
dasmy Sep 8, 2023
aa51d89
copy static content into the right place
dasmy Sep 10, 2023
760a611
allow referencing environment variables in APP_SERVICE_CONFIG
dasmy Sep 11, 2023
751b233
update default packages
dasmy Sep 11, 2023
c3a7050
do not upgrade deps for now as we do not have network access from the…
dasmy Sep 11, 2023
436d9f3
install rdkit by default
dasmy Sep 11, 2023
f9a8181
install libXrender inside container. - apparently needed for `from r…
dasmy Sep 12, 2023
f6f91dc
another missing dependency for rdkit
dasmy Sep 12, 2023
06a45b5
add scikit-learn and scipy
dasmy Sep 13, 2023
c4a5800
Allow disabling the automated pip calls via env variable. This is nec…
dasmy Sep 13, 2023
5056374
remove option to set the API key
dasmy Sep 18, 2023
b737803
some company branding
dasmy Sep 18, 2023
8d0f1c1
fix default model name
dasmy Sep 18, 2023
f2b413c
fix initial/default model selection
dasmy Sep 19, 2023
e5b69f4
fix page title
dasmy Sep 28, 2023
cc5bc67
improve kernel status handling
dasmy Sep 28, 2023
57655b8
do not follow redirects in /api call responses. This happens due to r…
dasmy Sep 28, 2023
ec55cd9
Safari deals badly with svg favicons. Use png instead.
dasmy Sep 29, 2023
bf00932
add py3Dmol to the list of pre-installed packages
dasmy Oct 4, 2023
4ee64ae
fix status during code generation
dasmy Oct 6, 2023
824b3cd
improve command handling
dasmy Oct 6, 2023
07d6a82
add command for explicitly clearing the conversation history
dasmy Oct 6, 2023
bb30bd3
some cleanup and formatting
dasmy Oct 11, 2023
a14bc57
add endpoint to interact with foundry data
dasmy Oct 11, 2023
c4492f5
provide frontend functionality for foundry interaction
dasmy Oct 11, 2023
5c15dcb
improve output of column names
dasmy Oct 11, 2023
5f866d0
allow navigating back to previous prompts
dasmy Oct 16, 2023
bce66d7
some more type-safety in Typescript
dasmy Oct 17, 2023
9d20d12
some documentation/cleanup
dasmy Oct 18, 2023
2dee297
.gitignore
dasmy Oct 18, 2023
63bb03c
do not leak runtime environment variables into the kernel
dasmy Oct 18, 2023
cbf1dfa
improve error handling
dasmy Oct 18, 2023
ee9dda7
try some hardening, especially do not run as root user
dasmy Oct 19, 2023
34b4242
could not get py3Dmol to run properly
dasmy Oct 20, 2023
987df24
use material component for model selection dropdown
dasmy Oct 20, 2023
9d42d3d
small wording fix
dasmy Oct 20, 2023
5e8b1ad
Bump semver from 7.5.1 to 7.5.4 in /frontend
dependabot[bot] Oct 20, 2023
e7cbc93
Bump postcss from 8.4.23 to 8.4.31 in /frontend
dependabot[bot] Oct 20, 2023
eca7971
Bump word-wrap from 1.2.3 to 1.2.5 in /frontend
dependabot[bot] Oct 20, 2023
faceac1
fix readme
dasmy Oct 20, 2023
c831d84
GPT sometimes includes the language spec in the markdown block - do n…
dasmy Oct 20, 2023
ca29795
cleanup readme
dasmy Oct 20, 2023
5ea75f7
less aggressive output truncation
dasmy Oct 20, 2023
04f64a3
Merge pull request #1 from merckgroup/dependabot/npm_and_yarn/fronten…
dasmy Oct 23, 2023
651b931
Merge pull request #2 from merckgroup/dependabot/npm_and_yarn/fronten…
dasmy Oct 23, 2023
55fa032
Merge pull request #3 from merckgroup/dependabot/npm_and_yarn/fronten…
dasmy Oct 23, 2023
7cd75b1
present a few rows of sample data to improve filtering capabilities
dasmy Oct 24, 2023
805ca03
fix cut-off label in Foundry dialog, see https://github.com/mui/mater…
dasmy Oct 24, 2023
bedffc6
add a hint, while foundry access might not work
dasmy Oct 30, 2023
560a969
improve error handling for foundry dataset download
dasmy Oct 30, 2023
d767dff
hide some process information, see https://superuser.com/a/704035
dasmy Nov 9, 2023
0670755
Initial config for AppService deployment
dasmy Aug 7, 2023
c50966e
use env settings from APP_SERVICE_CONFIG
dasmy Sep 8, 2023
88abd7b
copy static content into the right place
dasmy Sep 10, 2023
de4473a
allow referencing environment variables in APP_SERVICE_CONFIG
dasmy Sep 11, 2023
8153b41
update default packages
dasmy Sep 11, 2023
67f45f8
do not upgrade deps for now as we do not have network access from the…
dasmy Sep 11, 2023
667ce6e
install rdkit by default
dasmy Sep 11, 2023
43fd9f9
install libXrender inside container. - apparently needed for `from r…
dasmy Sep 12, 2023
e6b50f6
another missing dependency for rdkit
dasmy Sep 12, 2023
5e64335
add scikit-learn and scipy
dasmy Sep 13, 2023
86a2677
Allow disabling the automated pip calls via env variable. This is nec…
dasmy Sep 13, 2023
cacbdd8
remove option to set the API key
dasmy Sep 18, 2023
865fc55
some frontend and style fixes
dasmy Jan 4, 2024
8f1e7d8
fix default model name
dasmy Sep 18, 2023
7cd4339
fix initial/default model selection
dasmy Sep 19, 2023
02a1fdc
fix page title
dasmy Sep 28, 2023
5433ad7
improve kernel status handling
dasmy Sep 28, 2023
968cd47
do not follow redirects in /api call responses.
dasmy Sep 28, 2023
ed28f83
add py3Dmol to the list of pre-installed packages
dasmy Oct 4, 2023
9d4bdf4
fix status during code generation
dasmy Oct 6, 2023
b3bf5c9
improve command handling
dasmy Oct 6, 2023
3982160
add command for explicitly clearing the conversation history
dasmy Oct 6, 2023
e1974c2
some cleanup and formatting
dasmy Oct 11, 2023
e834429
add endpoint to interact with foundry data (list all datasets in fold…
dasmy Jan 4, 2024
048ba48
provide frontend functionality for foundry interaction
dasmy Oct 11, 2023
f62738b
improve output of column names
dasmy Oct 11, 2023
73a9422
allow navigating back to previous prompts
dasmy Oct 16, 2023
42ed71f
some more type-safety in Typescript
dasmy Oct 17, 2023
e9e77ef
some documentation/cleanup
dasmy Jan 4, 2024
4601891
.gitignore
dasmy Oct 18, 2023
d26d80e
do not leak runtime environment variables into the kernel
dasmy Oct 18, 2023
48dee44
improve error handling
dasmy Oct 18, 2023
f1bf5e6
try some hardening, especially do not run as root user
dasmy Oct 19, 2023
34951ad
could not get py3Dmol to run properly
dasmy Oct 20, 2023
e8f03a9
use material component for model selection dropdown
dasmy Oct 20, 2023
c3ae5d7
small wording fix
dasmy Oct 20, 2023
c91470a
fix readme
dasmy Oct 20, 2023
9caa5eb
GPT sometimes includes the language spec in the markdown block - do n…
dasmy Oct 20, 2023
c79d982
cleanup readme
dasmy Jan 4, 2024
d91c16a
less aggressive output truncation
dasmy Oct 20, 2023
e169442
Bump semver from 7.5.1 to 7.5.4 in /frontend
dependabot[bot] Oct 20, 2023
501461f
Bump postcss from 8.4.23 to 8.4.31 in /frontend
dependabot[bot] Oct 20, 2023
d2b5477
Bump word-wrap from 1.2.3 to 1.2.5 in /frontend
dependabot[bot] Oct 20, 2023
cbc76ca
present a few rows of sample data to improve filtering capabilities
dasmy Oct 24, 2023
1f8a8b7
fix cut-off label in Foundry dialog, see https://github.com/mui/mater…
dasmy Oct 24, 2023
20244e0
improve error handling for foundry dataset download
dasmy Oct 30, 2023
524ce9e
hide some process information, see https://superuser.com/a/704035
dasmy Nov 9, 2023
28c7f91
fix typo in prompt
dasmy Jan 5, 2024
1351d92
fixes from https://github.com/jogeorg/gpt-code-budget/commit/52903ca4…
dasmy Jan 5, 2024
cab8d2c
changes from https://github.com/jogeorg/gpt-code-budget/commit/85dc23…
dasmy Jan 5, 2024
e63fbf4
update API version
dasmy Jan 5, 2024
b8db84d
make dropdown text readable
dasmy Jan 5, 2024
9afa5e7
some updates to README
dasmy Jan 5, 2024
96a7e13
Add action to build a docker image
dasmy Jan 5, 2024
166dd35
add demo video
dasmy Jan 5, 2024
03dbe9b
fix size of video dialog
dasmy Jan 15, 2024
a59e015
add annoying Disclaimer popup
dasmy Jan 15, 2024
2d6b266
tiny update to trigger the build pipeline
dasmy Jan 15, 2024
f25a150
add wordcloud support
dasmy Jan 17, 2024
dfa91a3
add XlsxWriter package just in case GPT would like to use it for writ…
dasmy Jan 18, 2024
923b333
Bump vite from 4.3.9 to 4.5.2 in /frontend
dependabot[bot] Jan 20, 2024
719553b
Fix typo in README (#19)
nicornk Jan 22, 2024
accfd18
Fix typo in README (#19)
nicornk Jan 22, 2024
8dc35d6
Merge pull request #4 from merckgroup/dependabot/npm_and_yarn/fronten…
dasmy Jan 22, 2024
c412a68
duplicate pre-commit hooks from molecule-mate, run them for initial c…
dasmy Jan 22, 2024
a703c31
factor LLM-related functions into separate module
dasmy Feb 1, 2024
ec88557
update readme to latest changes
dasmy Feb 1, 2024
f3781a5
fix typo
dasmy Feb 2, 2024
c22a907
fix initialization of model list box selection
dasmy Feb 2, 2024
593b0e8
improve foundry download error message
dasmy Feb 2, 2024
1cc127f
suggest Viva Engage instead of the Ensemble Community
dasmy Feb 2, 2024
25ec87c
stdin input does not make sense in the ipython kernel
dasmy Feb 8, 2024
6e3fc32
add svg support in frontend
dasmy Feb 10, 2024
c4974ff
fix error handling after openai library version update
dasmy Feb 10, 2024
3d10772
allow setting boolean options in frontend and pass them to the code e…
dasmy Feb 10, 2024
4a01e5f
allow switching to svg figures without conversion of text to paths
dasmy Feb 10, 2024
4c77fd4
tell the model to stay away from fiddling with fonts
dasmy Feb 11, 2024
ba3f526
make configuration options in sidebar more intuitive: cancel button a…
dasmy Feb 11, 2024
ffe5959
fix model selection
dasmy Feb 14, 2024
5d4c0b1
make special commands case-insensitive
dasmy Feb 16, 2024
7894db1
notify the user if they opened two tabs that might interfere with eac…
dasmy Feb 17, 2024
b001c33
track time of last access to individual kernels
dasmy Feb 17, 2024
6287dc6
use an additional thread to monitor last acces times of kernel manage…
dasmy Feb 18, 2024
da398e0
try to streamline the kernel exit process
dasmy Feb 19, 2024
58535cd
remove snakemq which was a rather redundant message queue
dasmy Feb 23, 2024
e6a4f7e
start kernels asynchronously
dasmy Feb 23, 2024
b9f9a2b
make system prompt adjustable, add some unit tests
dasmy Feb 25, 2024
608ebe5
switch to poetry
dasmy Feb 25, 2024
d60828f
Add support for custom functions that can be run inside the kernel
dasmy Feb 25, 2024
65513b3
more pre-commit checks, clenup some dependencies, run pre-commit chec…
dasmy Feb 25, 2024
21ad983
add support for drawing multiple molecules, fix support for None retu…
dasmy Feb 25, 2024
814fa00
use vector graphics output in draw_smiles()
dasmy Feb 26, 2024
fa71300
add podman commands to Makefile
dasmy Feb 26, 2024
03be150
explicitly set the workdir as ipython dir
dasmy Feb 27, 2024
9fb5bc6
try catching errors when accessing the backend
dasmy Feb 27, 2024
c1e2d5a
restart webapp and kernel in case they crash
dasmy Feb 27, 2024
99ed78a
add special command for interrupting long-running computations
dasmy Feb 28, 2024
00f646d
some refactoring of frontend code
dasmy Feb 28, 2024
23ef244
add kernel controls to sidebar, use Stack component for horizontal an…
dasmy Feb 29, 2024
3b3710c
add docx and bio packages
dasmy Feb 29, 2024
7768076
be a bit less verbose about the kernel state
dasmy Feb 29, 2024
d5d5955
Avoid flushing kernel messages from two different threads at the same…
dasmy Feb 29, 2024
b6e64df
refactor Chat.tsx to allow for simpler extension to more output types
dasmy Mar 1, 2024
f13f187
add support for py3Dmol plots
dasmy Mar 4, 2024
8b5b034
tiny improvement to hourglass animation
dasmy Mar 4, 2024
a6ff483
add logging facilities to web frontend to make potential post-mortem …
dasmy Mar 4, 2024
084b38d
make figures adjustable in size via drag and drop
dasmy Mar 6, 2024
686094c
add changelog
dasmy Mar 6, 2024
ef1eea3
update eslint config, fix ost eslint errors
dasmy Mar 7, 2024
b131474
fixed the remaining eslint warnings
dasmy Mar 7, 2024
69d1127
add pre-commit config for running eslint
dasmy Mar 7, 2024
2a5ab34
duplicate pre-commit hooks from molecule-mate, run them for initial c…
dasmy Jan 22, 2024
ab2bbbe
factor LLM-related functions into separate module
dasmy Feb 1, 2024
11c284f
update readme to latest changes
dasmy Feb 1, 2024
b3e8340
fix typo
dasmy Feb 2, 2024
fe07fd1
fix initialization of model list box selection
dasmy Feb 2, 2024
db1b122
improve foundry download error message
dasmy Feb 2, 2024
ec67d74
add Disclaimer markdown
dasmy Feb 2, 2024
a3b0fa3
stdin input does not make sense in the ipython kernel
dasmy Feb 8, 2024
4447bd9
add svg support in frontend
dasmy Feb 10, 2024
0f39d13
fix error handling after openai library version update
dasmy Feb 10, 2024
4a767f1
allow setting boolean options in frontend and pass them to the code e…
dasmy Feb 10, 2024
c9a2ed9
allow switching to svg figures without conversion of text to paths
dasmy Feb 10, 2024
8f73b46
tell the model to stay away from fiddling with fonts
dasmy Feb 11, 2024
595d3d1
make configuration options in sidebar more intuitive: cancel button a…
dasmy Feb 11, 2024
c3b5390
fix model selection
dasmy Feb 14, 2024
40d6513
make special commands case-insensitive
dasmy Feb 16, 2024
68fdb1f
notify the user if they opened two tabs that might interfere with eac…
dasmy Feb 17, 2024
1058db5
track time of last access to individual kernels
dasmy Feb 17, 2024
7a1ab4e
use an additional thread to monitor last acces times of kernel manage…
dasmy Feb 18, 2024
904c6f3
try to streamline the kernel exit process
dasmy Feb 19, 2024
d28e164
remove snakemq which was a rather redundant message queue
dasmy Feb 23, 2024
83a0811
start kernels asynchronously
dasmy Feb 23, 2024
09769c1
make system prompt adjustable, add some unit tests
dasmy Feb 25, 2024
d405e66
switch to poetry
dasmy Feb 25, 2024
c236079
Add support for custom functions that can be run inside the kernel
dasmy Feb 25, 2024
dc3e20b
more pre-commit checks, clenup some dependencies, run pre-commit chec…
dasmy Feb 25, 2024
e3774a4
add support for drawing multiple molecules, fix support for None retu…
dasmy Feb 25, 2024
d5e1944
use vector graphics output in draw_smiles()
dasmy Feb 26, 2024
f5d098f
add podman commands to Makefile
dasmy Feb 26, 2024
af45201
explicitly set the workdir as ipython dir
dasmy Feb 27, 2024
1315219
try catching errors when accessing the backend
dasmy Feb 27, 2024
8b0a0eb
restart webapp and kernel in case they crash
dasmy Feb 27, 2024
95d264c
add special command for interrupting long-running computations
dasmy Feb 28, 2024
cffee51
some refactoring of frontend code
dasmy Feb 28, 2024
9c5487c
add kernel controls to sidebar, use Stack component for horizontal an…
dasmy Feb 29, 2024
21923a8
add docx and bio packages
dasmy Feb 29, 2024
e90b8d4
be a bit less verbose about the kernel state
dasmy Feb 29, 2024
e6946bc
Avoid flushing kernel messages from two different threads at the same…
dasmy Feb 29, 2024
a7d54ac
refactor Chat.tsx to allow for simpler extension to more output types
dasmy Mar 1, 2024
56a511a
add support for py3Dmol plots
dasmy Mar 4, 2024
0e63662
tiny improvement to hourglass animation
dasmy Mar 4, 2024
4838afe
add logging facilities to web frontend to make potential post-mortem …
dasmy Mar 4, 2024
fa22c1d
make figures adjustable in size via drag and drop
dasmy Mar 6, 2024
71d338d
add changelog
dasmy Mar 6, 2024
e6dbd68
update eslint config, fix ost eslint errors
dasmy Mar 7, 2024
84bd645
fixed the remaining eslint warnings
dasmy Mar 7, 2024
bb5dab6
add pre-commit config for running eslint
dasmy Mar 7, 2024
698709e
Merge branch 'dasmy' into appservice
dasmy Mar 8, 2024
3f63d48
add demo video
dasmy Mar 8, 2024
6a53b32
Fix video link in README
dasmy Mar 8, 2024
35fbed1
allow hiding the code, this is enabled by default but can be changed …
dasmy Mar 13, 2024
14f6817
add option to attempt fixing execution errors automatically
dasmy Mar 15, 2024
b010111
Merge commit '698709eef530488a9a360ff7978053920c64e9cf' into dasmy
dasmy Mar 15, 2024
ecdee41
Merge branch 'appservice' into dasmy
dasmy Mar 15, 2024
c45fe07
update changelog
dasmy Mar 15, 2024
a170b88
add support for printing the chat history, this also allows creating …
dasmy Mar 18, 2024
f0c8111
add a .../sessions endpoint that lists all sessions with their last a…
dasmy Mar 18, 2024
a980b47
improve storage handling
dasmy Mar 19, 2024
ce96f95
Set default Foundry folder to as this should be readable by everybody
dasmy Mar 19, 2024
698577f
refactoring of Foundry dialog, added support for folder navigation
dasmy Mar 19, 2024
35aa91d
Merge branch 'appservice' into dasmy
dasmy Mar 20, 2024
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
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.git
app.log
workspace
.pytest_cache
tests
*.egg-info
dist
.mypy_cache
.ruff_cache
.github
.gitignore
.ipynb_checkpoints
.DS_Store
.devcontainer
.vscode
scripts
10 changes: 0 additions & 10 deletions .env.azure-example

This file was deleted.

27 changes: 20 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
AZURE_API_KEY=XXXX
AZURE_API_BASE=https://your-resource-name.openai.azure.com
AZURE_API_VERSION=2023-09-01-preview

OPENAI_API_KEY=sk-XXXX
OPENAI_API_TYPE=open_ai
OPENAI_API_BASE=https://api.openai.com/v1
OPENAI_API_VERSION=2023-03-15-preview
# OPENAI_EXTRA_HEADERS={"key": "value"}
OPENAI_MODELS=[{"displayName": "GPT-3.5", "name": "gpt-3.5-turbo"}, {"displayName": "GPT-4", "name": "gpt-4"}]
# OPENAI_API_LOGLEVEL=debug

BEDROCK_GATEWAY_API_KEY=YYYY
BEDROCK_GATEWAY_API_BASE=https://your-gateway-url.com

AVAILABLE_MODELS=[{"displayName": "GPT-3.5 16k", "name": "azure/gpt-35-turbo-16k"}, {"displayName": "GPT-3.5 0613", "name": "azure/gpt-35-turbo-0613"}, {"displayName": "Claude v1", "name": "bedrock_gateway/anthropic.claude-instant-v1"}, {"displayName": "Claude v2", "name": "bedrock_gateway/anthropic.claude-v2"}]

API_PORT=5010
WEB_PORT=8080
SNAKEMQ_PORT=8765

SESSION_ENCRYPTION_KEY="<SECRET_KEY>"

DEBUG=1
NO_INTERNET_AVAILABLE=0
OPENAI_API_LOGLEVEL=debug
FOUNDRY_DATA_FOLDER=/Global/Foundry Training and Resources/Example Data/Aviation Ontology

KERNEL_MANAGER_WATCHDOG_INTERVAL_S=60
KERNEL_MANAGER_TIMEOUT_S=3600
7 changes: 3 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To run the backend:
gptcode
```

To run the frontend in dev mode such that frontend code changes automatically update, set
To run the frontend in dev mode such that frontend code changes automatically update, set
the following environment variable such that the frontend knows where to
find the backend API server.

Expand All @@ -48,7 +48,7 @@ npm run dev

The HMR/auto reloading version of the frontend can now be found at http://localhost:5173 (default Vite port)

Note, the frontend served at `http://localhost:8080` is stale comes from the static bundled files that can
Note, the frontend served at `http://localhost:8080` is stale comes from the static bundled files that can
be generated by running `make compile_frontend`.

With this setup, code changes to the Flask backend still require restarting `gptcode` (backend).
Expand Down Expand Up @@ -78,7 +78,7 @@ We welcome ideas for improvements and new features. To suggest an enhancement, o

### Code Style

gpt-code-ui uses [Black](https://black.readthedocs.io/en/stable/the_black_code_style/index.html) as its code style guide. Please ensure that your code follows these guidelines.
gpt-code-ui uses [Black](https://black.readthedocs.io/en/stable/the_black_code_style/index.html) as its code style guide. Please ensure that your code follows these guidelines.

### Commit Messages

Expand All @@ -91,4 +91,3 @@ Write clear and concise commit messages that briefly describe the changes made i
- [Black](https://black.readthedocs.io/en/stable/the_black_code_style/index.html)

Thank you once again for your interest in contributing to gpt-code-ui. We look forward to collaborating with you and creating an even better project together!

9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ body:
4. Observe the error.
validations:
required: true

- type: textarea
id: possible-solution
attributes:
label: Possible solution
description: |
Not obligatory, but please suggest a fix or reason for the bug, if you have an idea.
Not obligatory, but please suggest a fix or reason for the bug, if you have an idea.


- type: checkboxes
id: operating-systems
Expand All @@ -81,7 +81,7 @@ body:
placeholder: Typescript vX.Y / Python v3.xx
validations:
required: true

- type: input
id: gpt-code-ui-version
attributes:
Expand All @@ -105,4 +105,3 @@ body:
required: true
- label: 'I have provided enough information for the maintainers to reproduce and diagnose the issue.'
required: true

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/ricklamers/gpt-code-ui/discussions/categories/q-a
about: Ask questions and discuss with other community members
about: Ask questions and discuss with other community members
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body:
label: "📝 Additional Context"
description: "Add any other context or screenshots about the feature request here."
placeholder: "..."

- type: checkboxes
id: acknowledgements
attributes:
Expand All @@ -60,4 +60,4 @@ body:
- label: 'I have searched the existing issues to make sure this feature has not been requested yet.'
required: true
- label: 'I have provided enough information for the maintainers to understand and evaluate this request.'
required: true
required: true
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag code-impact:$(date +%s)
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# Program related
process_pids/
kernel.*
kernel_connection_file.json

# Python stuff
Expand All @@ -19,4 +20,7 @@ __pycache__/
*.log

dist/
build/
build/
.app_service_config.json
.DS_Store
.ipynb_checkpoints
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: check-case-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
# - id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.11
hooks:
# Run the linter.
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
# Run the formatter.
- id: ruff-format
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.1.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
# TODO enable after fixing existing issues
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
hooks:
- id: mypy
additional_dependencies: [types-requests==2.31.0.20240106]
args: [--implicit-optional]
- repo: local
hooks:
- id: eslint
name: eslint_frontend
entry: ./frontend/node_modules/.bin/eslint --fix
files: ^frontend/.*\.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
language: system
75 changes: 75 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
FROM node:16.16.0-alpine AS uibuild
RUN apk add --no-cache make rsync
RUN mkdir frontendbuild
WORKDIR /frontendbuild
COPY Makefile ./
COPY frontend/ ./frontend
COPY pyproject.toml ./
COPY gpt_code_ui/webapp/static ./gpt_code_ui/webapp/static
RUN ls -al .
RUN make compile_frontend


FROM python:3.10-slim as backendbuild
# runtime binary dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libxrender1 \
libxext6 \
curl \
; \
rm -rf /var/lib/apt/lists/*

ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=0 \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
POETRY_HOME='/usr/local' \
POETRY_VERSION=1.7.1

RUN curl -sSL https://install.python-poetry.org | python3 -

RUN mkdir backendbuild
WORKDIR /backendbuild

# first install only dependencies
COPY poetry.lock pyproject.toml ./
RUN touch README.md
RUN poetry install --without dev --without devtools --no-root --no-ansi && rm -rf $POETRY_CACHE_DIR


# install actual project
COPY run_with_app_service_config.py ./
COPY gpt_code_ui/ ./gpt_code_ui
RUN poetry install --without dev --without devtools --no-ansi && rm -rf $POETRY_CACHE_DIR

# Inject frontend into backend resources to be served from there
COPY --from=uibuild /frontendbuild/frontend/dist/ ./gpt_code_ui/webapp/static

RUN mkdir workspace
RUN chmod 0777 workspace
RUN touch app.log
RUN chmod 0777 app.log

RUN ls -al .
RUN ls -al ./gpt_code_ui
RUN which python

EXPOSE 8080

# restrict access to /proc to make it more difficult to access other proccesses, see https://superuser.com/a/704035
RUN cat /etc/fstab
RUN ls -al /etc/fstab
RUN echo "proc /proc proc nosuid,nodev,noexec,hidepid=2 0 0" >> /etc/fstab
RUN cat /etc/fstab

RUN adduser --no-create-home gpt_code_ui
USER gpt_code_ui

CMD ["python", "./run_with_app_service_config.py", "./gpt_code_ui/main.py"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
28 changes: 20 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.PHONY: all compile_frontend bundle_pypi upload_pypi increment_version release check_env_var
.PHONY: all container_image container_run compile_frontend bundle_pypi upload_pypi increment_version release check_env_var

all: check_env_var build upload_pypi

build: check_env_var compile_frontend bundle_pypi

increment_version:
@VERSION=$$(grep -e "^\s*version='[^']*'" setup.py | cut -d "'" -f 2) && \
@VERSION=$$(grep -e '^\s*version\s*=\s*"[^"]*"' pyproject.toml | cut -d '"' -f 2) && \
MAJOR=$$(echo $$VERSION | cut -d. -f1) && \
MINOR=$$(echo $$VERSION | cut -d. -f2) && \
PATCH=$$(echo $$VERSION | cut -d. -f3) && \
NEW_PATCH=$$((PATCH + 1)) && \
NEW_VERSION="$$MAJOR.$$MINOR.$$NEW_PATCH" && \
sed -i.bak "s/version='[^']*'/version='$$NEW_VERSION'/" setup.py && \
rm setup.py.bak && \
sed -i.bak "s/$$VERSION/$$NEW_VERSION/" pyproject.toml && \
rm -f pyproject.toml.bak && \
echo "Updated version to $$NEW_VERSION"


Expand All @@ -22,16 +22,28 @@ release:
compile_frontend:
cd frontend && \
npm install && \
VITE_APP_VERSION=$$(grep -e "^\s*version='[^']*'" ../setup.py | cut -d "'" -f 2) npm run build && \
VITE_APP_VERSION=$$(grep -e '^\s*version\s*=\s*"[^"]*"' ../pyproject.toml | cut -d '"' -f 2) npm run build && \
find ../gpt_code_ui/webapp/static -mindepth 1 ! -name '.gitignore' -delete && \
rsync -av dist/ ../gpt_code_ui/webapp/static

container_image:
podman build . --tag=gpt_code_ui

container_run:
podman run \
--env 'APP_SERVICE_CONFIG=$(shell cat .app_service_config.json)' \
--env "FOUNDRY_DEV_TOOLS_FOUNDRY_URL=$(shell grep -e 'foundry_url' $$HOME/.foundry-dev-tools/config | cut -d '=' -f 2 | awk '{$$1=$$1;print}')" \
--env "FOUNDRY_DEV_TOOLS_JWT=$(shell grep -e 'jwt' $$HOME/.foundry-dev-tools/config | cut -d '=' -f 2 | awk '{$$1=$$1;print}')" \
-p=8080:8080/tcp \
--name="GPT-Code-UI" \
localhost/gpt_code_ui:latest

bundle_pypi:
rm -rf dist build && \
python3 setup.py sdist bdist_wheel
poetry build

upload_pypi:
twine upload dist/*
upload_pypi: bundle_pypi
poetry publish

check_env_var:
ifeq ($(VITE_WEB_ADDRESS),)
Expand Down
Loading