Skip to content

Commit 3954da8

Browse files
switch to railway from heroku for section 06 - 08 (#857)
* switch to railway for section 06-08
1 parent 3de716b commit 3954da8

File tree

8 files changed

+37
-47
lines changed

8 files changed

+37
-47
lines changed

.circleci/config.yml

+30-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
version: 2
1+
version: '2.1'
2+
orbs:
3+
node: circleci/[email protected]
24

35
defaults: &defaults
46
docker:
@@ -40,15 +42,19 @@ jobs:
4042
command: |
4143
tox
4244
43-
section_07_deploy_app_to_heroku:
45+
section_07_deploy_app_to_railway:
4446
<<: *defaults
4547
steps:
4648
- checkout:
47-
path: ~/project
49+
path: ~/project/
50+
- node/install:
51+
node-version: '16.13'
52+
- run: node --version
53+
- run: npm i -g @railway/cli
4854
- run:
49-
name: Deploy to Heroku
55+
name: Deploy to Railway App (You must set RAILWAY_TOKEN env var)
5056
command: |
51-
git subtree push --prefix section-07-ci-and-publishing/house-prices-api https://heroku:[email protected]/$HEROKU_APP_NAME.git master
57+
cd section-07-ci-and-publishing/house-prices-api && railway up --detach
5258
5359
section_07_test_and_upload_regression_model:
5460
<<: *defaults
@@ -71,28 +77,22 @@ jobs:
7177
tox -e publish_model
7278
7379
74-
section_08_deploy_app_container_in_heroku:
80+
section_08_deploy_app_container_via_railway:
7581
<<: *defaults
7682
steps:
7783
- setup_remote_docker:
7884
# Supported versions: https://circleci.com/docs/2.0/building-docker-images/#docker-version
79-
version: 20.10.6
85+
version: 20.10.18
8086
- checkout:
81-
path: ~/project
82-
- run:
83-
name: Build image
84-
command: |
85-
sudo curl https://cli-assets.heroku.com/install.sh | sh
86-
cd section-08-deploying-with-containers && make build-ml-api-heroku
87-
- run:
88-
name: Push Image to Heroku
89-
command: |
90-
# Push the built container to the Heroku image registry
91-
cd section-08-deploying-with-containers && make push-ml-api-heroku
87+
path: ~/project/
88+
- node/install:
89+
node-version: '16.13'
90+
- run: node --version
91+
- run: npm i -g @railway/cli
9292
- run:
93-
name: Release to Heroku
93+
name: Build and run Dockerfile (see https://docs.railway.app/deploy/dockerfiles)
9494
command: |
95-
cd section-08-deploying-with-containers && make release-heroku
95+
cd section-08-deploying-with-containers && railway up --detach
9696
9797
test_regression_model_py37:
9898
docker:
@@ -265,24 +265,27 @@ tags_only: &tags_only
265265

266266
workflows:
267267
version: 2
268-
section_07:
268+
deploy_pipeline:
269269
jobs:
270270
- section_07_test_app
271-
- section_07_deploy_app_to_heroku:
271+
- section_07_deploy_app_to_railway:
272272
requires:
273273
- section_07_test_app
274274
filters:
275275
branches:
276276
only:
277277
- master
278+
- demo
278279
# upload after git tags are created
279280
- section_07_test_and_upload_regression_model:
280281
<<: *tags_only
281-
- section_08_deploy_app_container_in_heroku:
282-
filters:
283-
branches:
284-
only:
285-
- master
282+
283+
- section_08_deploy_app_container_via_railway:
284+
filters:
285+
branches:
286+
only:
287+
- master
288+
- demo
286289

287290
# test-all:
288291
# jobs:

section-06-model-serving-api/house-prices-api/runtime.txt

-1
This file was deleted.

section-07-ci-and-publishing/house-prices-api/runtime.txt

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.3
1+
4.0.5

section-07-ci-and-publishing/model-package/tox.ini

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ skipsdist = True
1515
[testenv]
1616
basepython = python
1717
install_command = pip install {opts} {packages}
18-
whitelist_externals = train
18+
whitelist_externals = train,python
1919

2020
passenv =
2121
KAGGLE_USERNAME
2222
KAGGLE_KEY
2323
GEMFURY_PUSH_URL
2424

2525
[testenv:test_package]
26+
whitelist_externals = python
2627
deps =
2728
-rrequirements/test_requirements.txt
2829

@@ -50,8 +51,9 @@ commands=
5051

5152
[testenv:fetch_data]
5253
envdir = {toxworkdir}/test_package
54+
whitelist_externals = unzip
5355
deps =
54-
{[testenv:test_package]deps}
56+
kaggle<1.6.0
5557

5658
setenv =
5759
{[testenv:test_package]setenv}
@@ -65,6 +67,7 @@ commands=
6567

6668
[testenv:publish_model]
6769
envdir = {toxworkdir}/test_package
70+
whitelist_externals = python
6871
deps =
6972
{[testenv:test_package]deps}
7073

section-08-deploying-with-containers/Makefile

-13
This file was deleted.

section-08-deploying-with-containers/house-prices-api/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pydantic>=1.10.4,<1.12.0
77
typing_extensions>=4.2.0,<5.0.0
88
loguru>=0.5.3,<1.0.0
99
# fetched from gemfury
10-
tid-regression-model==4.0.2
10+
tid-regression-model==4.0.5

section-08-deploying-with-containers/house-prices-api/runtime.txt

-1
This file was deleted.

0 commit comments

Comments
 (0)