Skip to content

Commit 325f39a

Browse files
committed
init
1 parent a33d671 commit 325f39a

22 files changed

+5424
-38
lines changed

.gcloudignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**
2+
!Dockerfile
3+
!requirements.txt
4+
!vertex.py

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ First off, thanks for taking the time to contribute!
22

33
## Please Complete the Following
44

5-
- [ ] I read [CONTRIBUTING.md](https://github.com/Cyclenerd/template/blob/master/CONTRIBUTING.md)
5+
- [ ] I read [CONTRIBUTING.md](https://github.com/Cyclenerd/google-cloud-gcp-openai-api/blob/master/CONTRIBUTING.md)
66

77
## Notes
88

.github/dependabot.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
- package-ecosystem: "pip"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/ci.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@ jobs:
1515
- name: 🛎️ Checkout
1616
uses: actions/checkout@v3
1717

18-
# Test
19-
- name: 🌡️ Test
20-
run: uname -a
18+
- name: Install dependencies 🔧
19+
run: sudo apt-get install flake8
2120

22-
# Test Linux operating systems
23-
- name: 🐧 Test Debian 11 (Bullseye)
24-
run: |
25-
docker pull debian:11
26-
docker run -v $PWD:/temp/test debian:11 uname -a
21+
- name: 🛎️ Checkout
22+
uses: actions/checkout@v3
23+
24+
# Check Bash scripts
25+
- name: Bash 🔎
26+
run: shellcheck *.sh
2727

28-
- name: 🐧 Test Rocky Linux 8
29-
run: |
30-
docker pull rockylinux:8
31-
docker run -v $PWD:/temp/test rockylinux:8 uname -a
28+
# Check Python code
29+
- name: Python 🔎
30+
run: flake8 --ignore=W292 --max-line-length=127 --show-source --statistics *.py

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__/

.gitpod.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ tasks:
44
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
55
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/cloud.google.gpg
66
sudo apt-get update -y
7-
sudo apt-get install -y \
8-
google-cloud-cli
7+
sudo apt-get install -y google-cloud-cli
8+
pip install -r requirements.txt
99
command: gcloud --version

CONTRIBUTING.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ $ git commit -m "A brief summary of the commit
1919
Start reading the code and you'll get the hang of it. It is optimized for readability:
2020

2121
* Please also update the documentation.
22-
* Space before the opening curly of a multi-line BLOCK.
23-
* No space before the semicolon.
24-
* Space around most operators.
25-
* No space between function name and its opening parenthesis.
26-
* Line up corresponding things vertically, especially if it'd be too long to fit on one line anyway.
27-
* Please use tabs to indent.
22+
* Please check you Bash scripts with [ShellCheck](https://www.shellcheck.net/).
23+
* Please check your Python code with [Flake8](https://flake8.pycqa.org/en/latest/index.html).
2824
* Be nice.
2925

3026
One more thing:

Dockerfile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2023 Nils Knieling
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# The python:3.11-slim tag points to the latest release based on Debian 12 (bookworm)
16+
FROM python:3.11-slim
17+
18+
# Labels
19+
LABEL org.opencontainers.image.title "OpenAI API for Google Cloud Vertex AI"
20+
LABEL org.opencontainers.image.description "Drop-in replacement REST API for Google Cloud Vertex AI that is compatible with the OpenAI API specifications"
21+
LABEL org.opencontainers.image.url "https://hub.docker.com/r/cyclenerd/google-cloud-gcp-openai-api"
22+
LABEL org.opencontainers.image.authors "https://github.com/Cyclenerd/google-cloud-gcp-openai-api/graphs/contributors"
23+
LABEL org.opencontainers.image.documentation "https://github.com/Cyclenerd/google-cloud-gcp-openai-api/blob/master/README.md"
24+
LABEL org.opencontainers.image.source "https://github.com/Cyclenerd/google-cloud-gcp-openai-api/pkgs/container/google-cloud-gcp-openai-api"
25+
26+
# Log Python messages immediately instead of being buffered
27+
ENV PYTHONUNBUFFERED True
28+
29+
# Disable any healthcheck inherited from the base image
30+
HEALTHCHECK NONE
31+
32+
# Default HTTP port
33+
EXPOSE 8000
34+
35+
# Copy app to container
36+
WORKDIR /app
37+
COPY requirements.txt ./
38+
COPY vertex.py ./
39+
RUN pip install -r requirements.txt; \
40+
pip cache purge
41+
CMD ["python", "vertex.py"]
42+
43+
# If you're reading this and have any feedback on how this image could be
44+
# improved, please open an issue or a pull request so we can discuss it!
45+
#
46+
# https://github.com/Cyclenerd/google-cloud-gcp-openai-api

0 commit comments

Comments
 (0)