Skip to content
Snippets Groups Projects
Commit f11bdb68 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Use curl to download files & remember to install cmake

parent d6c426f8
No related branches found
No related tags found
No related merge requests found
ARG IMAGE_NAME=nvidia/cuda ARG IMAGE_NAME=nvidia/cuda
FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
# Install dependencies: cmake, python 3.6, wget # Install dependencies: python 3.6, curl, git
RUN apt-get update && apt-get install -y --no-install-recommends cmake python3 curl git RUN apt-get update && apt-get install -y --no-install-recommends python3 curl git
# Install cmake
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_64.sh -o cmake.sh && \
bash ./cmake.sh --skip-license --prefix=/usr && rm cmake.sh
# Install conda # Install conda
RUN curl https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh -o anaconda.sh && \ RUN curl https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh -o anaconda.sh && \
......
#!/bin/bash #!/bin/bash
# Run installer script # Run installer script and pass on args to installer that can parse them
# Pass on args to installer that can parse them
scripts/hpvm_installer.py "$@" scripts/hpvm_installer.py "$@"
# Set path. ret_code=$?
export PATH=$BUILD_DIR/bin:$PATH echo "Installer returned with code $ret_code"
exit $ret_code
...@@ -7,7 +7,7 @@ from typing import List ...@@ -7,7 +7,7 @@ from typing import List
VERSION = "9.0.0" VERSION = "9.0.0"
URL = "http://releases.llvm.org" URL = "http://releases.llvm.org"
WGET = "wget" DOWNLOADER = "curl"
CLANG_DIR = f"cfe-{VERSION}.src" CLANG_DIR = f"cfe-{VERSION}.src"
CLANG_TARBALL = f"{CLANG_DIR}.tar.xz" CLANG_TARBALL = f"{CLANG_DIR}.tar.xz"
LLVM_DIR = f"llvm-{VERSION}.src" LLVM_DIR = f"llvm-{VERSION}.src"
...@@ -181,7 +181,7 @@ def check_download_llvm_clang(): ...@@ -181,7 +181,7 @@ def check_download_llvm_clang():
else: else:
print(f"Downloading {LLVM_TARBALL}...") print(f"Downloading {LLVM_TARBALL}...")
print(f"=============================") print(f"=============================")
check_call([WGET, f"{URL}/{VERSION}/{LLVM_TARBALL}"]) download(f"{URL}/{VERSION}/{LLVM_TARBALL}", LLVM_TARBALL)
check_call(["tar", "xf", LLVM_TARBALL]) check_call(["tar", "xf", LLVM_TARBALL])
check_call(["mv", LLVM_DIR, "llvm"]) check_call(["mv", LLVM_DIR, "llvm"])
tools = Path("llvm/tools") tools = Path("llvm/tools")
...@@ -196,7 +196,7 @@ def check_download_llvm_clang(): ...@@ -196,7 +196,7 @@ def check_download_llvm_clang():
chdir(tools) chdir(tools)
print(f"Downloading {CLANG_TARBALL}...") print(f"Downloading {CLANG_TARBALL}...")
print(f"=============================") print(f"=============================")
check_call([WGET, f"{URL}/{VERSION}/{CLANG_TARBALL}"]) download(f"{URL}/{VERSION}/{CLANG_TARBALL}", CLANG_TARBALL)
check_call(["tar", "xf", CLANG_TARBALL]) check_call(["tar", "xf", CLANG_TARBALL])
check_call(["mv", CLANG_DIR, "clang"]) check_call(["mv", CLANG_DIR, "clang"])
assert Path("clang/").is_dir(), "Problem with clang download. Exiting!" assert Path("clang/").is_dir(), "Problem with clang download. Exiting!"
...@@ -214,7 +214,7 @@ def check_download_model_params(): ...@@ -214,7 +214,7 @@ def check_download_model_params():
else: else:
print(f"Downloading DNN model parameters: {MODEL_PARAMS_TAR}...") print(f"Downloading DNN model parameters: {MODEL_PARAMS_TAR}...")
print(f"=============================") print(f"=============================")
check_call([WGET, MODEL_PARAMS_LINK, "-O", MODEL_PARAMS_TAR]) download(MODEL_PARAMS_LINK, MODEL_PARAMS_TAR)
print( print(
f"Extracting DNN model parameters {MODEL_PARAMS_TAR} => {MODEL_PARAMS_DIR}..." f"Extracting DNN model parameters {MODEL_PARAMS_TAR} => {MODEL_PARAMS_DIR}..."
) )
...@@ -310,6 +310,10 @@ def input_with_check(prompt: str, parse, prompt_when_invalid: str): ...@@ -310,6 +310,10 @@ def input_with_check(prompt: str, parse, prompt_when_invalid: str):
return value return value
def download(link: str, output: Path):
check_call(["curl", "-L", link, "-o", output])
def main(): def main():
from sys import argv from sys import argv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment