{"id":18903983,"url":"https://github.com/dudeperf3ct/8-fastapi-tests-gcp-gke","last_synced_at":"2026-05-08T13:16:01.252Z","repository":{"id":191864853,"uuid":"438607751","full_name":"dudeperf3ct/8-fastapi-tests-gcp-gke","owner":"dudeperf3ct","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-15T12:04:46.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-24T11:38:31.970Z","etag":null,"topics":["docker","fastapi","gke","mlops","model-serving"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dudeperf3ct.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-12-15T11:40:47.000Z","updated_at":"2023-03-04T09:02:06.000Z","dependencies_parsed_at":"2023-09-01T07:12:37.439Z","dependency_job_id":null,"html_url":"https://github.com/dudeperf3ct/8-fastapi-tests-gcp-gke","commit_stats":null,"previous_names":["dudeperf3ct/8-fastapi-tests-gcp-gke"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dudeperf3ct/8-fastapi-tests-gcp-gke","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudeperf3ct%2F8-fastapi-tests-gcp-gke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudeperf3ct%2F8-fastapi-tests-gcp-gke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudeperf3ct%2F8-fastapi-tests-gcp-gke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudeperf3ct%2F8-fastapi-tests-gcp-gke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dudeperf3ct","download_url":"https://codeload.github.com/dudeperf3ct/8-fastapi-tests-gcp-gke/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudeperf3ct%2F8-fastapi-tests-gcp-gke/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32781942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","fastapi","gke","mlops","model-serving"],"created_at":"2024-11-08T09:07:00.058Z","updated_at":"2026-05-08T13:16:01.229Z","avatar_url":"https://github.com/dudeperf3ct.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentiment Classification\n\nExposed endpoint : http://34.72.165.159:8000/\n\nIn this project, we will deploy a sentiment analyser model using fastapi on GCP using GKE.\n\n- Containerizing different components of projects\n- Writing tests and testing individual modules using `pytest`\n- Using [trunk](https://docs.trunk.io/) for automatic code checking, formatting and liniting\n- Deploying application on GKE\n\n## Run\n\n### Locally\n\n- Sentiment Model\n\n```bash\ncd sentiment\ndocker build -t sentiment -f Dockerfile.t .\ncd ..\ndocker run --rm -it -v $(pwd):/app sentiment bash\npython3 sentiment/model.py\npytest tests/test_sentiment_model.py\n```\n\n- FastAPI\n\n\u003e Note: To run `pytest` replace `requirements-fastapi.txt` with `requirements-dev.txt` in `Dockerfile`\n\n```bash\ndocker build -t sentiment -f Dockerfile.fastapi .\ndocker run --rm -it -v $(pwd):/app -p 8000:8000 sentiment bash\nuvicorn main:app --host=0.0.0.0\npytest --cov tests/\n```\n\n- GKE\n\nDeploy the application on Google Kubernetes Engine (GKE).\n\nGuide: https://cloud.google.com/kubernetes-engine/docs/how-to/automated-deployment\n\n\u003e Expose port of 8000 after deploy under `Workloads \u003e ACTIONS \u003e Expose` in Kubernetes Engine. \n\n\u003e Setup up automatic deploy using Cloud Build and Github under `Workloads \u003e ACTIONS \u003e Automated deployment`. \n\nTest the application endpoint\n\n```bash\ncurl -X 'POST' \\\n  'http://34.72.165.159:8000/classify?input_text=i%20like%20you' \\\n  -H 'accept: application/json' \\\n  -d ''\n```\n\n## Additional Exercise\n\n- Deploy this application using gcloud cli","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdudeperf3ct%2F8-fastapi-tests-gcp-gke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdudeperf3ct%2F8-fastapi-tests-gcp-gke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdudeperf3ct%2F8-fastapi-tests-gcp-gke/lists"}