Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 7c82cef

Browse files
authored
Update makefile (#73)
* docs and setup: updating Makefile to work * makefile update: move scripts to osism subdirectory, adapt makefile to contain osism sepcific commands and more general commands * fix: reset requirement.txt to normal version * feat: reorganise menu, fix: add dependencies to commands, feat: add menu for container related commands * fix: remove duplicate script * fix: change name of get configs file Signed-off-by: Boekhorst <[email protected]>
1 parent 1dfe578 commit 7c82cef

File tree

3 files changed

+58
-24
lines changed

3 files changed

+58
-24
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unset SSH_AUTH_SOCK

Makefile

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ help: ## Display this help message
3434
@echo -e '\n${COLOUR_RED}Usage: make <command>${COLOUR_END}'
3535
@cat $(MAKEFILE_LIST) | grep '^[a-zA-Z]' | \
3636
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n\n", $$1, "${COLOUR_GREEN}"$$2"${COLOUR_END}"}'
37-
@echo -e '${COLOUR_RED}OSISM helperscript usage: make <command>${COLOUR_END}'
37+
@echo -e '${COLOUR_RED}Container related commands${COLOUR_END}'
38+
@cat $(MAKEFILE_LIST) | grep '^[a-zA-Z]' | \
39+
awk -F ':.*?#container# ' 'NF==2 {printf " %-26s%s\n\n", $$1, "${COLOUR_GREEN}"$$2"${COLOUR_END}"}'
40+
@echo -e '${COLOUR_RED}OSISM helperscripts${COLOUR_END}'
3841
@cat $(MAKEFILE_LIST) | grep '^[a-zA-Z]' | \
3942
awk -F ':.*?#osism# ' 'NF==2 {printf " %-26s%s\n\n", $$1, "${COLOUR_GREEN}"$$2"${COLOUR_END}"}'
4043

@@ -66,53 +69,55 @@ check-radoslib: ## Checks if radoslib is installed and if it contains the right
6669
./scripts/check_local_rados_lib_installation.sh ${RADOSLIB_VERSION}
6770

6871
.PHONY: build-local-rookify
69-
build-local-rookify: ## This builds rookify into .venv/bin/rookify
72+
build-local-rookify: setup ## This builds rookify into .venv/bin/rookify
7073
source .venv/bin/activate && pip install -e .
7174

72-
.PHONY: build-container
73-
build-container: ## Build container from Dockerfile, add e.g. ROOKIFY_VERSION=0.0.1 to specify the version. Default value is 0.0.0.dev1
74-
${CONTAINERCMD} build --build-arg ROOKIFY_VERSION=$(ROOKIFY_VERSION) --target rookify -t rookify:latest -f Dockerfile .
75-
7675
.PHONY: run-local-rookify
77-
run-local-rookify: ## Runs rookify in the local development environment (requires setup-venv)
78-
source ./.venv/bin/activate && pip install -e . && rookify
79-
80-
.PHONY: run-rookify
81-
run-rookify: ## Runs rookify in the container
82-
docker exec -it rookify-dev /app/rookify/.venv/bin/rookify
83-
84-
.PHONY: get-testbed-configs-for-rookify-testing
85-
get-testbed-configs-for-rookify-testing: ## Gets the needed config (like .kube, /etc/ceph and so on) from the testbed
86-
bash ./scripts/get_configs_from_testbed.sh
76+
run-local-rookify: build-local-rookify ## Runs rookify in the local development environment (requires setup-venv)
77+
./.venv/bin/rookify
8778

8879
.PHONY: run-tests-locally
89-
run-tests-locally: ## Runs the tests in the tests directory. NB: check that your local setup is connected through vpn to the testbed!
80+
run-tests-locally: setup-venv ## Runs the tests in the tests directory. NB: check that your local setup is connected through vpn to the testbed!
9081
.venv/bin/python -m pytest
9182

83+
##
84+
# Add container related commands here (so they appear below the container header)
85+
# Note: use #container# so command appear under header in menu
86+
##
87+
9288
.PHONY: run-tests
93-
run-tests: up ## Runs the tests in the container
89+
run-tests: up #container# Runs the tests in the container
9490
${CONTAINERCMD} exec -it rookify-dev bash -c "/app/rookify/.venv/bin/python -m pytest"
9591

92+
.PHONY: run-rookify
93+
run-rookify: up #container# Runs rookify in the container
94+
${CONTAINERCMD} exec -it rookify-dev /app/rookify/.venv/bin/rookify
95+
9696
.PHONY: enter
97-
enter: ## Enter the container
97+
enter: up #container# Enter the container
9898
${CONTAINERCMD} exec -it rookify-dev bash
9999

100100
.PHONY: logs
101-
logs: ## Logs the container
101+
logs: #container# Logs the container
102102
${CONTAINERCMD} logs -f rookify-dev
103103

104104
.PHONY: down
105-
down: ## Remove the containers as setup by docker-compose.yml
105+
down: #container# Remove the containers as setup by docker-compose.yml
106106
${CONTAINERCMD} compose down
107107

108108
.PHONY: up
109-
up: ## Sets up the container as specified in docker-compose.yml and opens a bash terminal
109+
up: #container# Sets up the container as specified in docker-compose.yml and opens a bash terminal
110110
${CONTAINERCMD} compose up -d
111111

112+
.PHONY: build-container
113+
build-container: #container# Build container from Dockerfile only, add e.g. ROOKIFY_VERSION=0.0.1 to specify the version. Default value is 0.0.0.dev1
114+
${CONTAINERCMD} build --build-arg ROOKIFY_VERSION=$(ROOKIFY_VERSION) --target rookify -t rookify:latest -f Dockerfile .
115+
112116
##
113-
# Add osism specific scripts below here (so they appear below helper header)
117+
# Add osism specific scripts below here
118+
# Note: use #osism# so command appear under header in menu
114119
##
115120

116121
.PHONY: get-config
117122
get-config: #osism# Gets configuration files from the OSISM testbed
118-
./scripts/osism/get_osism_configs_from_testbed.sh
123+
./scripts/osism/get_configs_from_testbed.sh
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Helperscript: Gets configs from testbed
2+
#
3+
# NOTE: this is for test purposes and specific for the OISISM testbed
4+
# it requires .ssh/config to be set accordingly, e.g.:
5+
#
6+
# Host testbed-*
7+
# StrictHostKeyChecking no
8+
# IdentityFile <id_rsa of testbed>
9+
# IdentitiesOnly yes
10+
# user dragon
11+
#
12+
# Host testbed-manager
13+
# Hostname <ip of manager of testbed>
14+
#
15+
# Host testbed-node-0
16+
# Hostname 192.168.16.10
17+
#
18+
# Host testbed-node-1
19+
# Hostname 192.168.16.11
20+
# Host testbed-node-2
21+
# Hostname 192.168.16.12
22+
#
23+
24+
# copy .kube to ./.k8s
25+
scp -r testbed-manager:.kube ./.k8s
26+
27+
# copy /etc/ceph/ from node1 to ./.k8s
28+
ssh testbed-manager "docker cp cephclient:/etc/ceph /tmp/cephclientconfig" && scp -r testbed-manager:/tmp/cephclientconfig ./.ceph && ssh testbed-manager "rm -rf /tmp/cephclientconfig"

0 commit comments

Comments
 (0)