-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b2f0c9
commit 88017e9
Showing
12 changed files
with
184 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Spil network deployment | ||
|
||
Client / Server deployment of Spil is still experimental, and work in progress. | ||
|
||
## Server side Spil | ||
|
||
A fastapi powered Spil REST API is currently under development. | ||
|
||
It allows access to the Crud interface via a rest api. | ||
- /find/{config}/{sid} | ||
- /get/{config}/{sid} | ||
- /write/{config}/{sid} | ||
|
||
 | ||
|
||
### Running the API | ||
|
||
- Either from the cloned repo: | ||
(includes creation of test data) | ||
```shell | ||
git clone https://github.com/MichaelHaussmann/spil.git | ||
cd spil | ||
python -c "import spil;import hamlet_scripts.save_examples_to_mock_fs as mfs;mfs.run()" | ||
cd spil_server/fastapi/app | ||
uvicorn main:app --reload | ||
``` | ||
|
||
The API will run on [http://127.0.0.1:8000/find](http://127.0.0.1:8000/find) and [http://127.0.0.1:8000/get](http://127.0.0.1:8000/get) | ||
Example: [http://127.0.0.1:8000/find/all/hamlet/a/**/maya?asset=*&task=rig&version=v001](http://127.0.0.1:8000/find/all/hamlet/a/**/maya?asset=*&task=rig&version=v001) | ||
|
||
|
||
- Using Docker compose | ||
```shell | ||
git clone https://github.com/MichaelHaussmann/spil.git | ||
cd spil | ||
docker compose up -d | ||
``` | ||
This will build `spil/spil_server/docker/Dockerfile` | ||
And run as defined in `spil/docker-compose.yml` | ||
|
||
The API will run on [http://127.0.0.1/find](http://127.0.0.1/find) and [http://127.0.0.1/get](http://127.0.0.1/get) | ||
Example: [http://127.0.0.1/find/all/hamlet/a/**/maya?asset=*&task=rig&version=v001](http://127.0.0.1/find/all/hamlet/a/**/maya?asset=*&task=rig&version=v001) | ||
|
||
|
||
### Production config | ||
|
||
Check out comments in the Dockerfile `spil/spil_server/docker/Dockerfile` | ||
and the docker-compose `spil/docker-compose.yml` | ||
It is possible to map a production configuration onto the docker config folder. | ||
|
||
|
||
## Client Side Spil | ||
|
||
A FindInSpilRest Finder is also in development. | ||
|
||
It is able to consume the Spil rest API. | ||
This Finder can replace any other finder, and be used without any change in the code. | ||
|
||
**This is not currently implemented** | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
installation | ||
configuration | ||
configuration_advanced | ||
client_server | ||
|
||
.. toctree:: | ||
:caption: User Guides | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# type: ignore | ||
""" | ||
Demo configuration for the rest API. | ||
Defines Finder and Getter instances for routes formatted as: | ||
"/find/{config}/{search:path}" | ||
where "config" is the name of the config. | ||
""" | ||
from spil import FindInList | ||
from spil import FindInAll, GetFromAll, FindInPaths, GetFromPaths | ||
# from spil_plugins.sg.get_sg import GetFromSG | ||
# from spil_plugins.sg.find_sg import FindInSG | ||
from spil_hamlet_conf.hamlet_scripts.example_sids import sids | ||
|
||
|
||
# Example: | ||
# "/find/all/hamlet/*" | ||
# will call FindInAll().find() | ||
finder_config = { | ||
# 'sg': FindInSG(), | ||
'all': FindInAll(), | ||
'paths': FindInPaths(), | ||
'ls': FindInList(list(sids)) | ||
} | ||
|
||
|
||
# Example: | ||
# "/get/all/hamlet/*" | ||
# will call GetFromAll().get() | ||
getter_config = { | ||
# 'sg': GetFromSG(), | ||
'all': GetFromAll(), | ||
'paths': GetFromPaths() | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters