Skip to content
Draft
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
61 changes: 31 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: 2
version: '2.1'
orbs:
node: circleci/node@5.1.0

defaults: &defaults
docker:
Expand All @@ -21,7 +23,7 @@ prepare_tox: &prepare_tox

fetch_data: &fetch_data
run:
name: Set script permissions and fetch data
name: Fetch data
command: |
source venv/bin/activate
chmod +x ./scripts/fetch_kaggle_dataset.sh
Expand All @@ -40,15 +42,19 @@ jobs:
command: |
tox

section_07_deploy_app_to_heroku:
section_07_deploy_app_to_railway:
<<: *defaults
steps:
- checkout:
path: ~/project
path: ~/project/
- node/install:
node-version: '16.13'
- run: node --version
- run: npm i -g @railway/cli
- run:
name: Deploy to Heroku
name: Deploy to Railway App (You must set RAILWAY_TOKEN env var)
command: |
git subtree push --prefix section-07-ci-and-publishing/house-prices-api https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master
cd section-07-ci-and-publishing/house-prices-api && railway up --detach --project $RAILWAY_PROJECT_ID --environment production --service $RAILWAY_SERVICE_ID

section_07_test_and_upload_regression_model:
<<: *defaults
Expand All @@ -71,28 +77,20 @@ jobs:
tox -e publish_model


section_08_deploy_app_container_in_heroku:
section_08_deploy_app_container_via_railway:
<<: *defaults
steps:
- setup_remote_docker:
# Supported versions: https://circleci.com/docs/2.0/building-docker-images/#docker-version
version: 20.10.6
- setup_remote_docker
- checkout:
path: ~/project
- run:
name: Build image
command: |
sudo curl https://cli-assets.heroku.com/install.sh | sh
cd section-08-deploying-with-containers && make build-ml-api-heroku
- run:
name: Push Image to Heroku
command: |
# Push the built container to the Heroku image registry
cd section-08-deploying-with-containers && make push-ml-api-heroku
path: ~/project/
- node/install:
node-version: '16.13'
- run: node --version
- run: npm i -g @railway/cli
- run:
name: Release to Heroku
name: Build and run Dockerfile (see https://docs.railway.app/deploy/dockerfiles)
command: |
cd section-08-deploying-with-containers && make release-heroku
cd section-08-deploying-with-containers && railway up --detach --project $RAILWAY_PROJECT_ID --environment production --service $RAILWAY_SERVICE_ID

test_regression_model_py37:
docker:
Expand Down Expand Up @@ -265,24 +263,27 @@ tags_only: &tags_only

workflows:
version: 2
section_07:
deploy_pipeline:
jobs:
- section_07_test_app
- section_07_deploy_app_to_heroku:
- section_07_deploy_app_to_railway:
requires:
- section_07_test_app
filters:
branches:
only:
- master
- demo
# upload after git tags are created
- section_07_test_and_upload_regression_model:
<<: *tags_only
- section_08_deploy_app_container_in_heroku:
filters:
branches:
only:
- master

- section_08_deploy_app_container_via_railway:
filters:
branches:
only:
- master
- demo

# test-all:
# jobs:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
Accompanying repo for the online course Deployment of Machine Learning Models.

For the documentation, visit the [course on Udemy](https://www.udemy.com/deployment-of-machine-learning-models/?couponCode=TIDREPO).


An update.
Original file line number Diff line number Diff line change
Expand Up @@ -4611,8 +4611,8 @@
"source": [
"# Additional Resources\n",
"\n",
"- [Feature Engineering for Machine Learning](https://www.udemy.com/course/feature-engineering-for-machine-learning/?referralCode=A855148E05283015CF06) - Online Course\n",
"- [Packt Feature Engineering Cookbook](https://www.packtpub.com/data/python-feature-engineering-cookbook) - Book\n",
"- [Feature Engineering for Machine Learning](https://www.trainindata.com/p/feature-engineering-for-machine-learning) - Online Course\n",
"- [Packt Feature Engineering Cookbook](https://www.amazon.com/Python-Feature-Engineering-Cookbook-transforming-dp-1804611301/dp/1804611301) - Book\n",
"- [Predict house price with Feature-engine](https://www.kaggle.com/solegalli/predict-house-price-with-feature-engine) - Kaggle kernel\n",
"- [Comprehensive data exploration with Python](https://www.kaggle.com/pmarcelino/comprehensive-data-exploration-with-python) - Kaggle kernel\n",
"- [How I made top 0.3% on a Kaggle competition](https://www.kaggle.com/lavanyashukla01/how-i-made-top-0-3-on-a-kaggle-competition) - Kaggle kernel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@
"\n",
"For the remaining categorical variables, we will group those categories that are present in less than 1% of the observations. That is, all values of categorical variables that are shared by less than 1% of houses, well be replaced by the string \"Rare\".\n",
"\n",
"To learn more about how to handle categorical variables visit our course [Feature Engineering for Machine Learning](https://www.udemy.com/course/feature-engineering-for-machine-learning/?referralCode=A855148E05283015CF06) in Udemy."
"To learn more about how to handle categorical variables visit our course [Feature Engineering for Machine Learning](https://www.trainindata.com/p/feature-engineering-for-machine-learning)."
]
},
{
Expand Down Expand Up @@ -1805,7 +1805,7 @@
"\n",
"We will do it so that we capture the monotonic relationship between the label and the target.\n",
"\n",
"To learn more about how to encode categorical variables visit our course [Feature Engineering for Machine Learning](https://www.udemy.com/course/feature-engineering-for-machine-learning/?referralCode=A855148E05283015CF06) in Udemy."
"To learn more about how to encode categorical variables visit our course [Feature Engineering for Machine Learning](https://www.trainindata.com/p/feature-engineering-for-machine-learning)."
]
},
{
Expand Down Expand Up @@ -3083,9 +3083,9 @@
"\n",
"# Additional Resources\n",
"\n",
"- [Feature Engineering for Machine Learning](https://www.udemy.com/course/feature-engineering-for-machine-learning/?referralCode=A855148E05283015CF06) - Online Course\n",
"- [Packt Feature Engineering Cookbook](https://www.packtpub.com/data/python-feature-engineering-cookbook) - Book\n",
"- [Feature Engineering for Machine Learning: A comprehensive Overview](https://trainindata.medium.com/feature-engineering-for-machine-learning-a-comprehensive-overview-a7ad04c896f8) - Article\n",
"- [Feature Engineering for Machine Learning](https://www.trainindata.com/p/feature-engineering-for-machine-learning) - Online Course\n",
"- [Packt Feature Engineering Cookbook](https://www.amazon.com/Python-Feature-Engineering-Cookbook-transforming-dp-1804611301/dp/1804611301) - Book\n",
"- [Feature Engineering for Machine Learning: A comprehensive Overview](https://www.blog.trainindata.com/feature-engineering-for-machine-learning/) - Article\n",
"- [Practical Code Implementations of Feature Engineering for Machine Learning with Python](https://towardsdatascience.com/practical-code-implementations-of-feature-engineering-for-machine-learning-with-python-f13b953d4bcd) - Article"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,17 @@
"source": [
"# Additional Resources\n",
"\n",
"- [Feature Selection for Machine Learning](https://www.udemy.com/course/feature-selection-for-machine-learning/?referralCode=186501DF5D93F48C4F71) - Online Course\n",
"- [Feature Selection for Machine Learning: A comprehensive Overview](https://trainindata.medium.com/feature-selection-for-machine-learning-a-comprehensive-overview-bd571db5dd2d) - Article"
"- [Feature Selection for Machine Learning](https://www.trainindata.com/p/feature-selection-for-machine-learning) - Online Course\n",
"- [Feature Selection in Machine Learning with Python](https://leanpub.com/feature-selection-in-machine-learning/) - Book\n",
"- [Feature Selection for Machine Learning: A comprehensive Overview](https://www.blog.trainindata.com/feature-selection-for-machine-learning/) - Article"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@
"\n",
"We will do it so that we capture the monotonic relationship between the label and the target.\n",
"\n",
"To learn more about how to encode categorical variables visit our course [Feature Engineering for Machine Learning](https://www.udemy.com/course/feature-engineering-for-machine-learning/?referralCode=A855148E05283015CF06) in Udemy."
"To learn more about how to encode categorical variables visit our course [Feature Engineering for Machine Learning](https://www.trainindata.com/p/feature-engineering-for-machine-learning)."
]
},
{
Expand Down

Large diffs are not rendered by default.

Loading