-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
185 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
TAG=latest | ||
docker build docker -f docker/dev.x86_64.dockerfile -t ai-playground:$TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## ML Dev Docker | ||
|
||
### Build | ||
``` | ||
docker build . -f ml.dockerfiles -t registry.qcraftai.com/global/ml-dev-docker | ||
``` | ||
|
||
### Run | ||
``` | ||
docker run --runtime=nvidia -it registry.qcraftai.com/global/ml-dev-docker | ||
``` | ||
|
||
``` | ||
nvcc -V | ||
``` | ||
|
||
### References |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 | ||
LABEL maintainer="[email protected]" | ||
|
||
COPY installers/ /tmp/installers/ | ||
|
||
RUN bash /tmp/installers/install_minimal_environment.sh | ||
RUN bash /tmp/installers/install_developer_tools.sh | ||
RUN bash /tmp/installers/install_training_support.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
apt-get -y update \ | ||
&& apt-get install -y software-properties-common \ | ||
&& add-apt-repository ppa:deadsnakes/ppa | ||
|
||
apt install -y bash \ | ||
build-essential \ | ||
git \ | ||
git-lfs \ | ||
curl \ | ||
ca-certificates \ | ||
libsndfile1-dev \ | ||
libgl1 \ | ||
python3.10 \ | ||
python3-pip \ | ||
python3.10-venv && \ | ||
rm -rf /var/lib/apt/lists | ||
|
||
# Install bazel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
pip install --upgrade numpy torch accelerate triton torchvision transformers huggingface_hub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
set -u | ||
|
||
TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" | ||
source $TOP_DIR/scripts/playground.bashrc | ||
|
||
function _usage() { | ||
echo -e "\n${RED}Usage${NO_COLOR}: | ||
.${BOLD}/playground.sh${NO_COLOR} [OPTION]" | ||
echo -e "\n${RED}Options${NO_COLOR}: | ||
${BLUE}start_dev_docker [options]${NO_COLOR}: start a development docker container. | ||
${BLUE}stop_dev_docker [options]${NO_COLOR}: stop the development docker container. | ||
${BLUE}usage${NO_COLOR}: show this message and exit | ||
" | ||
} | ||
|
||
function start_dev_docker() { | ||
local image_name="ai-playground-dev:latest" | ||
local container_name="ai-playground-dev" | ||
local mount_dir="${TOP_DIR}" | ||
local mount_point="/ai-playground" | ||
|
||
if [ -z "$(docker ps -q -f name=$container_name)" ]; then | ||
echo "Starting dev docker container..." | ||
docker run -it --rm \ | ||
-v $mount_dir:$mount_point \ | ||
-w $mount_point \ | ||
--name $container_name \ | ||
$image_name \ | ||
/bin/bash | ||
else | ||
echo "Dev docker container is already running. Just attaching to it..." | ||
docker exec -it $container_name /bin/bash | ||
fi | ||
} | ||
|
||
function stop_dev_docker() { | ||
local container_name="ai-playground-dev" | ||
|
||
if [ -z "$(docker ps -q -f name=$container_name)" ]; then | ||
echo "Dev docker container is not running. Exiting..." | ||
exit 1 | ||
else | ||
echo "Stopping dev docker container..." | ||
docker stop $container_name | ||
fi | ||
} | ||
|
||
function main() { | ||
if [ "$#" -eq 0 ]; then | ||
_usage | ||
exit 0 | ||
fi | ||
|
||
local cmd="$1" | ||
shift | ||
|
||
case "$cmd" in | ||
start_dev_docker) | ||
start_dev_docker "$@" | ||
;; | ||
stop_dev_docker) | ||
stop_dev_docker "$@" | ||
;; | ||
usage) | ||
_usage | ||
;; | ||
-h | --help) | ||
_usage | ||
;; | ||
esac | ||
} | ||
|
||
main "$@" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
|
||
TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" | ||
|
||
: ${VERBOSE:=yes} | ||
|
||
BOLD='\033[1m' | ||
RED='\033[0;31m' | ||
BLUE='\033[1;34;48m' | ||
GREEN='\033[32m' | ||
WHITE='\033[34m' | ||
YELLOW='\033[33m' | ||
NO_COLOR='\033[0m' | ||
|
||
function info() { | ||
(echo >&2 -e "[${WHITE}${BOLD}INFO${NO_COLOR}] $*") | ||
} | ||
|
||
function error() { | ||
(echo >&2 -e "[${RED}ERROR${NO_COLOR}] $*") | ||
} | ||
|
||
function warning() { | ||
(echo >&2 -e "${YELLOW}[WARNING] $*${NO_COLOR}") | ||
} | ||
|
||
function ok() { | ||
(echo >&2 -e "[${GREEN}${BOLD} OK ${NO_COLOR}] $*") | ||
} | ||
|
||
function print_delim() { | ||
echo "==============================================" | ||
} | ||
|
||
function get_now() { | ||
date +%s | ||
} | ||
|
||
function time_elapsed_s() { | ||
local start="${1:-$(get_now)}" | ||
local end="$(get_now)" | ||
echo "$end - $start" | bc -l | ||
} | ||
|
||
function success() { | ||
print_delim | ||
ok "$1" | ||
print_delim | ||
} | ||
|
||
function fail() { | ||
print_delim | ||
error "$1" | ||
print_delim | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
|