Skip to content

Commit

Permalink
switch to railway from heroku for section 06 - 08 (#857)
Browse files Browse the repository at this point in the history
* switch to railway for section 06-08
  • Loading branch information
ChristopherGS authored Feb 20, 2023
1 parent 3de716b commit 3954da8
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 47 deletions.
57 changes: 30 additions & 27 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/[email protected]

defaults: &defaults
docker:
Expand Down Expand Up @@ -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:[email protected]/$HEROKU_APP_NAME.git master
cd section-07-ci-and-publishing/house-prices-api && railway up --detach
section_07_test_and_upload_regression_model:
<<: *defaults
Expand All @@ -71,28 +77,22 @@ 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
version: 20.10.18
- 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
test_regression_model_py37:
docker:
Expand Down Expand Up @@ -265,24 +265,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
1 change: 0 additions & 1 deletion section-06-model-serving-api/house-prices-api/runtime.txt

This file was deleted.

1 change: 0 additions & 1 deletion section-07-ci-and-publishing/house-prices-api/runtime.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.3
4.0.5
7 changes: 5 additions & 2 deletions section-07-ci-and-publishing/model-package/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ skipsdist = True
[testenv]
basepython = python
install_command = pip install {opts} {packages}
whitelist_externals = train
whitelist_externals = train,python

passenv =
KAGGLE_USERNAME
KAGGLE_KEY
GEMFURY_PUSH_URL

[testenv:test_package]
whitelist_externals = python
deps =
-rrequirements/test_requirements.txt

Expand Down Expand Up @@ -50,8 +51,9 @@ commands=

[testenv:fetch_data]
envdir = {toxworkdir}/test_package
whitelist_externals = unzip
deps =
{[testenv:test_package]deps}
kaggle<1.6.0

setenv =
{[testenv:test_package]setenv}
Expand All @@ -65,6 +67,7 @@ commands=

[testenv:publish_model]
envdir = {toxworkdir}/test_package
whitelist_externals = python
deps =
{[testenv:test_package]deps}

Expand Down
13 changes: 0 additions & 13 deletions section-08-deploying-with-containers/Makefile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pydantic>=1.10.4,<1.12.0
typing_extensions>=4.2.0,<5.0.0
loguru>=0.5.3,<1.0.0
# fetched from gemfury
tid-regression-model==4.0.2
tid-regression-model==4.0.5

This file was deleted.

0 comments on commit 3954da8

Please sign in to comment.