-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
138 lines (112 loc) · 3.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.DEFAULT_GOAL = help
prepare-mlops-crashcourse: welcome confirmation build-all ready
launch-mlops-crashcourse: create-network run-all open-ui
clean-mlops-crashcourse: stop-all remove-all remove-network clean-mlflow goodbye
#################
# DOCKER #
#################
create-network:
@echo "Creating the course docker network..."
-@docker network create --driver bridge mlops-crashcourse-supinfo
remove-network:
@echo "Removing the course docker network..."
-@docker network rm mlops-crashcourse-supinfo
build-all: build-jupyter build-mlflow
build-jupyter:
@echo "Building lesson jupyter lab container..."
@docker build -t mlops_notebooks_supinfo -f infra/jupyter/Dockerfile .
build-mlflow:
@echo "Building lesson mlflow container..."
@docker build -t mlops_mlflow_supinfo ./infra/mlflow_server/
remove-all:
@echo "Removing all course images..."
-@docker image rm mlops_notebooks_supinfo
-@docker image rm mlops_mlflow_supinfo
run-all: run-jupyter run-mlflow
run-jupyter:
./infra/jupyter/bin/run_lab.sh
run-mlflow:
./infra/mlflow_server/run_server.sh
stop-all:
@echo "Stopping all course containers..."
-@docker stop jupyter
-@docker stop mlflow
clean-mlflow:
@echo "Removing all mlflow data..."
-@rm -rf ./infra/mlflow_server/local/artifacts
-@rm -rf ./infra/mlflow_server/local/mlflow.db
#################
# CI #
#################
.PHONY: run-linter
run-linter:
@echo "Running linter and code formatting checks"
@isort . --check --diff --profile black
@black --check .
@flake8 .
.PHONY: install-precommit
install-precommit:
@pre-commit install -t pre-commit
.PHONY: format-code
format-code:
@pre-commit run --all-files
#################
# MISC #
#################
.PHONY: welcome
welcome:
@echo
@echo "Welcome to the Artefact MLOps crash course!"
@echo "This util will help you prepare the course dependencies and run them."
@echo "You can run 'make help' to see the available commands."
.PHONY: confirmation
confirmation:
@echo "We will now start the installation of course infrastructure."
@echo "If this fails, make sure Docker is installed and running."
@echo "This might take a few minutes depending on your computer and connexion."
@echo "Are you ready? [y/N] " && read ans && [ $${ans:-N} = y ]
.PHONY: ready
ready:
@echo
@echo "The docker images for the mlflow server and the jupyter lab have now been created."
@echo "Thank you for your patience!"
@echo "You can now run the command 'make launch-mlops-crashcourse' in the console to launch the course."
@echo
.PHONY: goodbye
goodbye:
@echo
@echo "Thanks for participating in the Artefact MLOps crash course!"
@echo
.PHONY: open-ui
open-ui:
@open http://localhost:5001
@open http://localhost:10000
.PHONY: help
help:
@echo
@echo "Welcome to the Artefact MLOps crash course!"
@echo "This util will help you prepare the course dependencies and run them."
@echo
@echo "Available commands:"
@echo
@echo "make prepare-mlops-crashcourse"
@echo " - Prepare the course environment by building the docker images."
@echo
@echo "make launch-mlops-crashcourse"
@echo " - Launch the course environment by running the docker containers."
@echo
@echo "make clean-mlops-crashcourse"
@echo " - Clean the course environment by removing the docker containers and images."
@echo
@echo "make run-linter"
@echo " - Run the linter and code formatting checks."
@echo
@echo "make install-precommit"
@echo " - Install the pre-commit hooks."
@echo
@echo "make format-code"
@echo " - Run the pre-commit hooks."
@echo
@echo "make help"
@echo " - Show this help message."
@echo