Add hello-world
This commit is contained in:
parent
da279152ba
commit
4ed5d70830
4 changed files with 37 additions and 4 deletions
|
|
@ -11,5 +11,6 @@ Dockerfile
|
||||||
.github
|
.github
|
||||||
.vscode
|
.vscode
|
||||||
docs
|
docs
|
||||||
|
!docs/hello_world.py
|
||||||
scripts
|
scripts
|
||||||
tests
|
tests
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ ENV ENVIRONMENT=production
|
||||||
EXPOSE 6060
|
EXPOSE 6060
|
||||||
|
|
||||||
# curl is needed for the healthcheck
|
# curl is needed for the healthcheck
|
||||||
|
# build-essentials are needed for building packages
|
||||||
RUN DEBIAN_FRONTEND=noninteractive apt update &&\
|
RUN DEBIAN_FRONTEND=noninteractive apt update &&\
|
||||||
apt install curl -y &&\
|
apt install curl build-essential -y &&\
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /dependencies
|
WORKDIR /dependencies
|
||||||
|
|
@ -29,4 +30,7 @@ HEALTHCHECK \
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
VOLUME /app
|
VOLUME /app
|
||||||
|
|
||||||
|
COPY docs/hello_world.py .
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/python3", "-m", "great_ai"]
|
ENTRYPOINT ["/usr/local/bin/python3", "-m", "great_ai"]
|
||||||
|
CMD ["hello_world.py"]
|
||||||
|
|
|
||||||
28
README.md
28
README.md
|
|
@ -1,12 +1,34 @@
|
||||||
# GreatAI
|
# GreatAI
|
||||||
|
|
||||||
|
**work in progress, do not use!**
|
||||||
|
|
||||||
[](https://github.com/ScoutinScience/great_ai/actions/workflows/check.yml) [](https://sonar.scoutinscience.com/dashboard?id=great-ai) [](https://github.com/ScoutinScience/great_ai/actions/workflows/publish.yaml) [](https://github.com/ScoutinScience/great_ai/actions/workflows/docker.yaml)
|
[](https://github.com/ScoutinScience/great_ai/actions/workflows/check.yml) [](https://sonar.scoutinscience.com/dashboard?id=great-ai) [](https://github.com/ScoutinScience/great_ai/actions/workflows/publish.yaml) [](https://github.com/ScoutinScience/great_ai/actions/workflows/docker.yaml)
|
||||||
|
|
||||||
|
|
||||||
|
## Find `great-ai` on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -p6060:6060 schmelczera/great-ai
|
||||||
|
```
|
||||||
|
|
||||||
|
Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/).
|
||||||
|
|
||||||
|
|
||||||
|
## Find `great-ai` on [PyPI](https://pypi.org/project/great-ai/)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install great-ai
|
pip install great-ai
|
||||||
```
|
```
|
||||||
|
|
||||||
Find it on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai)
|
```python
|
||||||
Find it on [PyPI](https://pypi.org/project/great-ai/)
|
from great_ai import GreatAI
|
||||||
|
|
||||||
**work in progress, do not use!**
|
@GreatAI.create
|
||||||
|
def hello_world(name: str) -> str:
|
||||||
|
return f"Hello {name}!"
|
||||||
|
```
|
||||||
|
> Create a new file called `main.py`
|
||||||
|
|
||||||
|
Deploy by executing `python3 -m great-ai main.py`
|
||||||
|
|
||||||
|
Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/).
|
||||||
|
|
|
||||||
6
docs/hello_world.py
Normal file
6
docs/hello_world.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
from great_ai import GreatAI
|
||||||
|
|
||||||
|
|
||||||
|
@GreatAI.create
|
||||||
|
def hello_world(name: str) -> str:
|
||||||
|
return f"Hello {name}!"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue