Skip to content

Commit

Permalink
Merge pull request #32 from numerai/pschork/bump_data_version
Browse files Browse the repository at this point in the history
Set default `--dataset` value to `v4.2/live_int8.parquet`
  • Loading branch information
pschork authored Nov 8, 2023
2 parents 5bf4b2b + 69a03d3 commit c0569d6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@ build: build_3_9 build_3_10 build_3_11 ## Build all Python containers

.PHONY: build_3_9
build_3_9: ## Build Python 3.9 container
docker build -t ${NAME}_py_3_9:${GIT_REF} -t ${NAME}_py_3_9:latest -f py3.9/Dockerfile .
docker build --build-arg GIT_REF=${GIT_REF} -t ${NAME}_py_3_9:${GIT_REF} -t ${NAME}_py_3_9:latest -f py3.9/Dockerfile .

.PHONY: build_3_10
build_3_10: ## Build Python 3.10 container
docker build -t ${NAME}_py_3_10:${GIT_REF} -t ${NAME}_py_3_10:latest -f py3.10/Dockerfile .
docker build --build-arg GIT_REF=${GIT_REF} -t ${NAME}_py_3_10:${GIT_REF} -t ${NAME}_py_3_10:latest -f py3.10/Dockerfile .

.PHONY: build_3_11
build_3_11: ## Build Python 3.11 container
docker build -t ${NAME}_py_3_11:${GIT_REF} -t ${NAME}_py_3_11:latest -f py3.11/Dockerfile .
docker build --build-arg GIT_REF=${GIT_REF} -t ${NAME}_py_3_11:${GIT_REF} -t ${NAME}_py_3_11:latest -f py3.11/Dockerfile .

.PHONY: test
test: test_3_9 test_3_10 test_3_11 ## Test all container versions

.PHONY: test_3_9
test_3_9: build_3_9 ## Test Python 3.9 pickle
docker run -i --rm -v ${PWD}:${PWD} -v /tmp:/tmp ${NAME}_py_3_9:latest --model ${PWD}/tests/models/model_3_9.pkl
docker run -i --rm -v ${PWD}:${PWD} -v /tmp:/tmp ${NAME}_py_3_9:latest --dataset=v4.1/live.parquet --model ${PWD}/tests/models/model_3_9.pkl

.PHONY: test_3_10
test_3_10: build_3_10 ## Test Python 3.10 pickle
docker run -i --rm -v ${PWD}:${PWD} -v /tmp:/tmp ${NAME}_py_3_10:latest --model ${PWD}/tests/models/model_3_10.pkl
docker run -i --rm -v ${PWD}:${PWD} -v /tmp:/tmp ${NAME}_py_3_10:latest --dataset=v4.1/live.parquet --model ${PWD}/tests/models/model_3_10.pkl

.PHONY: test_3_11
test_3_11: build_3_11 ## Test Python 3.11 pickle
docker run -i --rm -v ${PWD}:${PWD} -v /tmp:/tmp ${NAME}_py_3_11:latest --model ${PWD}/tests/models/model_3_11.pkl
docker run -i --rm -v ${PWD}:${PWD} -v /tmp:/tmp ${NAME}_py_3_11:latest --dataset=v4.1/live.parquet --model ${PWD}/tests/models/model_3_11.pkl

.PHONY: push_latest
push_latest: push_latest_3_9 push_latest_3_10 push_latest_3_11 ## Push latest docker containers
Expand Down
8 changes: 4 additions & 4 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parse_args():
group = parser.add_mutually_exclusive_group()
group.add_argument(
"--dataset",
default="v4.1/live.parquet",
default="v4.2/live_int8.parquet",
help="Numerapi dataset path or local file.",
)
group.add_argument(
Expand Down Expand Up @@ -65,7 +65,8 @@ def py_version(separator='.'):


def exit_with_help(error):
docker_image_path = f"ghcr.io/numerai/numerai_predict_py_{py_version('_')}:latest"
git_ref = os.getenv('GIT_REF', 'latest')
docker_image_path = f"ghcr.io/numerai/numerai_predict_py_{py_version('_')}:{git_ref}"
docker_args = "--debug --model $PWD/[PICKLE_FILE]"

logging.root.handlers[0].flush()
Expand All @@ -90,8 +91,7 @@ def exit_with_help(error):
def main(args):
logging.getLogger().setLevel(logging.DEBUG if args.debug else logging.INFO)

python_version = f"Python{py_version()}"
logging.info(python_version)
logging.info(f"Running numerai-predict:{os.getenv('GIT_REF')} Python{py_version()}")

if args.model.lower().startswith("http"):
truncated_url = args.model.split("?")[0]
Expand Down
2 changes: 2 additions & 0 deletions py3.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM python:3.10-slim

ARG GIT_REF
ENV GIT_REF=$GIT_REF
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
build-essential \
Expand Down
2 changes: 2 additions & 0 deletions py3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM python:3.11-slim

ARG GIT_REF
ENV GIT_REF=$GIT_REF
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
build-essential \
Expand Down
2 changes: 2 additions & 0 deletions py3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM python:3.9-slim

ARG GIT_REF
ENV GIT_REF=$GIT_REF
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
build-essential \
Expand Down

0 comments on commit c0569d6

Please sign in to comment.