Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.DS_Store
**/__pycache__
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
integration:
name: Continuous Integration
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ RUN pip install -r requirements.txt


# Run app.py when the container launches
CMD ["python", "app.py"]
CMD ["python", "app.py"]
22 changes: 22 additions & 0 deletions README.Docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Building and running your application

When you're ready, start your application by running:
`docker compose up --build`.

Your application will be available at http://localhost:8000.

### Deploying your application to the cloud

First, build your image, e.g.: `docker build -t myapp .`.
If your cloud uses a different CPU architecture than your development
machine (e.g., you are on a Mac M1 and your cloud provider is amd64),
you'll want to build the image for that platform, e.g.:
`docker build --platform=linux/amd64 -t myapp .`.

Then, push it to your registry, e.g. `docker push myregistry.com/myapp`.

Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/)
docs for more detail on building and pushing.

### References
* [Docker's Python guide](https://docs.docker.com/language/python/)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ array(['Time', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6', 'V7', 'V8', 'V9',

creditcard
==============================
change-somthing...

A credit card fraud detection project

Expand Down
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ def predict(input_data: PredictionInput):

if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8080)
uvicorn.run(app, host="127.0.0.1", port=8080)
49 changes: 49 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Docker compose reference guide at
# https://docs.docker.com/go/compose-spec-reference/

# Here the instructions define your application as a service called "server".
# This service is built from the Dockerfile in the current directory.
# You can add other services your application may depend on here, such as a
# database or a cache. For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
server:
build:
context: .
ports:
- 8000:8000

# The commented out section below is an example of how to define a PostgreSQL
# database that your application can use. `depends_on` tells Docker Compose to
# start the database before your application. The `db-data` volume persists the
# database data between container restarts. The `db-password` secret is used
# to set the database password. You must create `db/password.txt` and add
# a password of your choosing to it before running `docker compose up`.
# depends_on:
# db:
# condition: service_healthy
# db:
# image: postgres
# restart: always
# user: postgres
# secrets:
# - db-password
# volumes:
# - db-data:/var/lib/postgresql/data
# environment:
# - POSTGRES_DB=example
# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
# expose:
# - 5432
# healthcheck:
# test: [ "CMD", "pg_isready" ]
# interval: 10s
# timeout: 5s
# retries: 5
# volumes:
# db-data:
# secrets:
# db-password:
# file: db/password.txt

6 changes: 3 additions & 3 deletions data/raw.dvc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
outs:
- md5: 63310a287c47722acf1521efd0e0d061.dir
size: 150825054
nfiles: 2
- md5: f2c7448614b9ec3d9e7e25dac874171f.dir
size: 150828752
nfiles: 1
hash: md5
path: raw
32 changes: 16 additions & 16 deletions dvc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ stages:
deps:
- path: .\data\raw\creditcard.csv
hash: md5
md5: e8ffcd27762aaf279e268eb849a060f9
size: 150825054
md5: e90efcb83d69faf99fcab8b0255024de
size: 150828752
- path: .\src\data\make_dataset.py
hash: md5
md5: 5d87ea0853101b748b17af0be510c2ac
Expand All @@ -18,16 +18,16 @@ stages:
outs:
- path: .\data\processed\
hash: md5
md5: b21101ae3f5090f5af39e6f9cbdb21c3.dir
size: 151098829
md5: c1fe38e0fb7a0bc7f30cdd6de224dc94.dir
size: 151102527
nfiles: 2
train_model:
cmd: python .\src\models\train_model.py .\data\processed\
deps:
- path: .\data\processed\
hash: md5
md5: b21101ae3f5090f5af39e6f9cbdb21c3.dir
size: 151098829
md5: c1fe38e0fb7a0bc7f30cdd6de224dc94.dir
size: 151102527
nfiles: 2
- path: .\src\models\train_model.py
hash: md5
Expand All @@ -36,28 +36,28 @@ stages:
outs:
- path: .\models\
hash: md5
md5: 6191af90def2b514e1128c7d91ae5877.dir
size: 397817
md5: 22c6dbc96a821fb65feb74161acdbdfd.dir
size: 398777
nfiles: 1
visualize:
cmd: python .\src\visualization\visualize.py .\models\model.joblib .\data\processed\
deps:
- path: .\data\processed\
hash: md5
md5: 45207c27b5aec2846e4532f5bee1631f.dir
size: 151098829
md5: c1fe38e0fb7a0bc7f30cdd6de224dc94.dir
size: 151102527
nfiles: 2
- path: .\models\model.joblib
hash: md5
md5: e01830bd03da0f4f328c34580d40d5b3
size: 3865
md5: 1fab7c57e15f287ea2cc3d04f88ba0d9
size: 398777
- path: .\src\visualization\visualize.py
hash: md5
md5: db86d2e43c664f095353e9ba6afe3393
size: 3687
md5: a91ca79bfaea995c333fa50841f86fde
size: 3683
outs:
- path: dvclive
hash: md5
md5: e887b02afa678d483c083f4d3632dc94.dir
size: 18530385
md5: b1c83bd8c1ab9ef068bd867f7673cf6f.dir
size: 20018970
nfiles: 8
Loading