Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timm package #8

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Empty file added Caveats
Empty file.
Empty file added Downloading
Empty file.
Empty file added Fetching
Empty file.
112 changes: 111 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,113 @@
#################################################################################
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PRs to add packages should only modify the pixi.lock and pixi.toml files. See for example https://github.com/drivendataorg/literacy-screening-runtime/pull/6/files

# Settings #
#################################################################################
ifeq (, $(shell which nvidia-smi))
CPU_OR_GPU ?= cpu
else
CPU_OR_GPU ?= gpu
endif

BLOCK_INTERNET ?= true
PLATFORM_ARGS = --platform linux/amd64

TAG := ${CPU_OR_GPU}-latest
LOCAL_TAG := ${CPU_OR_GPU}-local

IMAGE_NAME = literacy-screening-competition
OFFICIAL_IMAGE = literacyscreening.azurecr.io/${IMAGE_NAME}
LOCAL_IMAGE = ${IMAGE_NAME}

# Resolve which image to use in commands. The priority is:
# 1. User-provided, e.g., SUBMISSION_IMAGE=my-image:gpu-local make test-submission
# 2. Local image, e.g., literacy-screening-competition:gpu-local
# 3. Official competition image, e.g., literacyscreening.azurecr.io/literacy-screening-competition
SUBMISSION_IMAGE ?= ${LOCAL_IMAGE}:${LOCAL_TAG}
ifeq (,$(shell docker images -q ${SUBMISSION_IMAGE}))
SUBMISSION_IMAGE = ${OFFICIAL_IMAGE}:${TAG}
endif

# Get the image ID
SUBMISSION_IMAGE_ID := $(shell docker images -q ${SUBMISSION_IMAGE})

# Name of the running container, i.e., docker run ... --name <CONTAINER_NAME>
CONTAINER_NAME ?= ${IMAGE_NAME}

# Enable or disable host GPU access
ifeq (${CPU_OR_GPU}, gpu)
GPU_ARGS = --gpus all
endif

SKIP_GPU ?= false
ifeq (${SKIP_GPU}, true)
GPU_ARGS =
endif

# If no TTY (for example GitHub Actions CI) no interactive tty commands for docker
ifneq (true, ${GITHUB_ACTIONS_NO_TTY})
TTY_ARGS = -it
endif

# Option to block or allow internet access from the submission Docker container
ifeq (true, ${BLOCK_INTERNET})
NETWORK_ARGS = --network none
endif

# Name of the example submission to pack when running `make pack-example`
EXAMPLE ?= random

.PHONY: _check_image _echo_image _submission_write_perms

# Give write access to the submission folder to everyone so Docker user can write when mounted
_submission_write_perms:
mkdir -p submission/
chmod -R 0777 submission/


_check_image:
# If container does not exist, error and tell user to pull or build
ifeq (${SUBMISSION_IMAGE_ID},)
$(error To test your submission, you must first run `make pull` (to get official container) or `make build` \
(to build a local version if you have changes).)
endif

_echo_image:
@echo
ifeq (,${SUBMISSION_IMAGE_ID})
@echo "$$(tput bold)Using image:$$(tput sgr0) ${SUBMISSION_IMAGE} (image does not exist locally)"
@echo
else
@echo "$$(tput bold)Using image:$$(tput sgr0) ${SUBMISSION_IMAGE} (${SUBMISSION_IMAGE_ID})"
@echo "┏"
@echo "┃ NAME(S)"

@docker inspect $(SUBMISSION_IMAGE_ID) --format='{{join .RepoTags "\n"}}' | awk '{print "┃ "$$0}'

@echo "└"
@echo
endif
ifeq (,$(shell docker images ${OFFICIAL_IMAGE} -q))
@echo "$$(tput bold)No official images available locally$$(tput sgr0)"
@echo "Run 'make pull' to download the official image."
@echo
else
@echo "$$(tput bold)Available official images:$$(tput sgr0)"
@echo "┏"
@docker images ${OFFICIAL_IMAGE} | awk '{print "┃ "$$0}'
@echo "└"
@echo
endif
ifeq (,$(shell docker images ${LOCAL_IMAGE} -q))
@echo "$$(tput bold)No local images available$$(tput sgr0)"
@echo "Run 'make build' to build the image."
@echo
else
@echo "$$(tput bold)Available local images:$$(tput sgr0)"
@echo "┏"
@docker images ${LOCAL_IMAGE} | awk '{print "┃ "$$0}'
@echo "└"
@echo
endif

#################################################################################
# Settings #
#################################################################################
Expand Down Expand Up @@ -279,4 +389,4 @@ help: _echo_image
printf "\n"; \
}' \
| more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
@echo
@echo
Empty file added Pouring
Empty file.
Empty file added Running
Empty file.
Empty file added Summary
Empty file.
Binary file added examples/.DS_Store
Binary file not shown.
Binary file added runtime/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
SHELL=/bin/bash

# Create user andset permissions

ENV RUNTIME_USER=runtimeuser
ENV RUNTIME_UID=1000
ENV RUNTIME_GID=1000
Expand Down
242 changes: 0 additions & 242 deletions runtime/pixi.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions runtime/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ tqdm = "4.66.*"
xgboost = "2.1.*"
python-levenshtein = "0.26.*"

[pypi-dependencies]
speechbrain = "==1.0.1"
openai-whisper = "==20240930"
opensmile = "==2.5.0"
#[pypi-dependencies]
#speechbrain = "==1.0.1"
#openai-whisper = "==20240930"
#opensmile = "==2.5.0"
Comment on lines +28 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting these out would remove them from the runtime environment, which is shared by all competitors. It's not allowed to remove or change the versions of any packages that are already installed

timm = "==1.0.12"

[feature.cuda]
platforms = ["linux-64"]
Expand Down