forked from mcgillmrl/metaworld_v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (57 loc) · 1.66 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
SHELL := /bin/bash
.PHONY: help test ci-job build-ci build-headlessrun-ci run-headless
.DEFAULT_GOAL := help
# Set the environment variable MJKEY with the contents of the file specified by
# MJKEY_PATH.
MJKEY_PATH ?= ~/.mujoco/mjkey.txt
test: ## Run the CI test suite locally
test: RUN_CMD = pytest -v
test: run
@echo "Running test suite..."
check-memory: ## Profile memory usage
check-memory: RUN_CMD = scripts/profile_memory_usage.py
check-memory: run
@echo "Profiling memory usage..."
ci-job:
pytest -n $$(nproc) --cov=metaworld -v
coverage xml
# bash <(curl -s https://codecov.io/bash)
ci-deploy-docker:
echo "${DOCKER_API_KEY}" | docker login -u "${DOCKER_USERNAME}" \
--password-stdin
docker tag "${TAG}" ryanjulian/metaworld-ci:latest
docker push ryanjulian/metaworld-ci
build-ci: TAG ?= ryanjulian/metaworld-ci:latest
build-ci: docker/docker-compose.yml
TAG=${TAG} \
docker-compose \
-f docker/docker-compose.yml \
build \
${ADD_ARGS}
run-ci: TAG ?= ryanjulian/metaworld-ci
run-ci:
docker run \
-e TRAVIS_BRANCH \
-e TRAVIS_PULL_REQUEST \
-e TRAVIS_COMMIT_RANGE \
-e TRAVIS \
-e MJKEY \
${ADD_ARGS} \
${TAG} ${RUN_CMD}
run: ## Run the Docker container on a local machine
run: CONTAINER_NAME ?= metaworld-ci
run: build-ci
docker run \
-it \
--rm \
-e MJKEY="$$(cat $(MJKEY_PATH))" \
--name $(CONTAINER_NAME) \
${ADD_ARGS} \
ryanjulian/metaworld-ci $(RUN_CMD)
# Help target
# See https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Display this message
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'