Skip to content

Commit

Permalink
[API] Support memray profiling [1.6.x] (mlrun#5570)
Browse files Browse the repository at this point in the history
(cherry picked from commit f29fe87)
  • Loading branch information
alonmr committed May 22, 2024
1 parent 1198ed4 commit 4516272
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ MLRUN_SKIP_COMPILE_SCHEMAS ?=
INCLUDE_PYTHON_VERSION_SUFFIX ?=
MLRUN_PIP_VERSION ?= 23.2.1
MLRUN_CACHE_DATE ?= $(shell date +%s)
MLRUN_MEMRAY ?= 0
MLRUN_MEMRAY_OUTPUT_FILE ?=
# empty by default, can be set to something like "tag-name" which will cause to:
# 1. docker pull the same image with the given tag (cache image) before the build
# 2. add the --cache-from flag to the docker build
Expand Down Expand Up @@ -567,6 +569,8 @@ run-api: api ## Run mlrun api (dockerized)
--env MLRUN_LOG_LEVEL=$(MLRUN_LOG_LEVEL) \
--env MLRUN_SECRET_STORES__TEST_MODE_MOCK_SECRETS=$(MLRUN_SECRET_STORES__TEST_MODE_MOCK_SECRETS) \
--env MLRUN_HTTPDB__REAL_PATH=$(MLRUN_HTTPDB__REAL_PATH) \
--env MLRUN_MEMRAY=$(MLRUN_MEMRAY) \
--env MLRUN_MEMRAY_OUTPUT_FILE=$(MLRUN_MEMRAY_OUTPUT_FILE) \
$(MLRUN_API_IMAGE_NAME_TAGGED)

.PHONY: run-test-db
Expand Down
5 changes: 5 additions & 0 deletions automation/patch_igz/patch-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ spec:
containers:
- name: mlrun-api
imagePullPolicy: Always
# env:
# - name: MLRUN_MEMRAY
# value: "1"
# - name: MLRUN_MEMRAY_OUTPUT_FILE
# value: "/mlrun/db/api_memray.bin"
- name: mlrun-log-collector
imagePullPolicy: Always
1 change: 1 addition & 0 deletions dockerfiles/mlrun-api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ sqlalchemy~=1.4
pymysql~=1.0
alembic~=1.9
timelength~=1.1
memray~=1.12

0 comments on commit 4516272

Please sign in to comment.