From db10ec1fdb16538ea953adb746a1a4e2a33e0538 Mon Sep 17 00:00:00 2001 From: Sanggyu Lee <8325289+gyusang@users.noreply.github.com> Date: Wed, 11 Oct 2023 04:55:46 +0000 Subject: [PATCH] Add Devcontainer --- .devcontainer/Dockerfile | 31 ++++++ .devcontainer/devcontainer.json | 32 +++++++ .gitignore | 162 ++++++++++++++++++++++++++++++++ pdm.lock | 106 +++++++++++++++++++++ pyproject.toml | 16 ++++ 5 files changed, 347 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitignore create mode 100644 pdm.lock create mode 100644 pyproject.toml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..2828fd1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,31 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG USER=vscode +RUN apt update \ + && apt install -y --no-install-recommends curl wget git sudo build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && usermod -s /usr/bin/zsh ${USER} + +USER ${USER} +ARG HOME="/home/${USER}" +WORKDIR ${HOME} + +ARG PYTHON_VERSION=3.10 +ENV PYENV_ROOT=${HOME}/.pyenv +ARG PYENV_PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims" +ARG PDM_PATH="${HOME}/.local/bin" +ENV PATH="${PYENV_PATH}:${PDM_PATH}:$PATH" +RUN set -x \ + && curl http://pyenv.run | bash \ + && echo 'eval "$(pyenv init -)"' >>${HOME}/.zshrc \ + && pyenv install -v ${PYTHON_VERSION} \ + && pyenv global ${PYTHON_VERSION} + +ARG ZSH_CUSTOM=${HOME}/.oh-my-zsh/custom +RUN curl -sSL https://pdm.fming.dev/install-pdm.py | python - \ + && mkdir ${ZSH_CUSTOM}/plugins/pdm \ + && pdm completion zsh > ${ZSH_CUSTOM}/plugins/pdm/_pdm \ + && sed -i "s|^plugins=(|&pdm |" ${HOME}/.zshrc \ + && echo 'eval $(pdm venv activate)' >>${HOME}/.zshrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..7ed2e4f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +{ + "name": "Python3 & pyenv & PDM", + "build": { + "dockerfile": "Dockerfile" + }, + // 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features. + // "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, + + // 👇 Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // 👇 Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "", + // 👇 Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "donjayamanne.python-environment-manager", + "DavidAnson.vscode-markdownlint", + "GitHub.copilot", + "ms-azuretools.vscode-docker" + ] + // "settings": { + // "shellformat.path": "/usr/local/bin/shfmt", + // "shellformat.useEditorConfig": true, + // "editor.defaultFormatter": "esbenp.prettier-vscode" + // } + } + } + // 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b3ab30 --- /dev/null +++ b/.gitignore @@ -0,0 +1,162 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml +.pdm-python +.pdm-build/ + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/pdm.lock b/pdm.lock new file mode 100644 index 0000000..02cf2e0 --- /dev/null +++ b/pdm.lock @@ -0,0 +1,106 @@ +# This file is @generated by PDM. +# It is not intended for manual editing. + +[metadata] +groups = ["default"] +cross_platform = true +static_urls = false +lock_version = "4.3" +content_hash = "sha256:e84c041ecdbb063de700a840b4abb4282ba5e154f4dde3f77c56c8126428124e" + +[[package]] +name = "jax" +version = "0.4.7" +requires_python = ">=3.8" +summary = "Differentiate, compile, and transform Numpy code." +dependencies = [ + "ml-dtypes>=0.0.3", + "numpy>=1.21", + "opt-einsum", + "scipy>=1.7", +] +files = [ + {file = "jax-0.4.7.tar.gz", hash = "sha256:5e7002d74db25f97c99b979d4ba1233b1ef26e1597e5fc468ad11d1c8a9dc4f8"}, +] + +[[package]] +name = "jaxlib" +version = "0.4.7+cuda11.cudnn82" +requires_python = ">=3.8" +url = "https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.4.7+cuda11.cudnn82-cp310-cp310-manylinux2014_x86_64.whl" +summary = "XLA library for JAX" +dependencies = [ + "ml-dtypes>=0.0.3", + "numpy>=1.21", + "scipy>=1.7", +] +files = [ + {file = "jaxlib-0.4.7+cuda11.cudnn82-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:6b98519cb79738b9d1ac5e43cd5c302a0b7c3d3c06e0347dac9287fd0fd93c37"}, +] + +[[package]] +name = "ml-dtypes" +version = "0.3.1" +requires_python = ">=3.9" +summary = "" +dependencies = [ + "numpy>1.20", + "numpy>=1.21.2; python_version > \"3.9\"", +] +files = [ + {file = "ml_dtypes-0.3.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:510d249a91face47211762eb294d6fe64f325356b965fb6388c1bf51bd339267"}, + {file = "ml_dtypes-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f83ff080df8910c0f987f615b03e4f8198638e0c00c6e679ea8892dda909763b"}, + {file = "ml_dtypes-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fcae2c69715410d96906e1dfe8f017d9f78a0d10e0df91aae52e91f51fdfe45e"}, + {file = "ml_dtypes-0.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:da274599e4950a9b488d21571061f49a185537cc77f2d3f8121151d58a9e9f16"}, + {file = "ml_dtypes-0.3.1.tar.gz", hash = "sha256:60778f99194b4c4f36ba42da200b35ef851ce4d4af698aaf70f5b91fe70fc611"}, +] + +[[package]] +name = "numpy" +version = "1.26.0" +requires_python = "<3.13,>=3.9" +summary = "Fundamental package for array computing in Python" +files = [ + {file = "numpy-1.26.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f8db2f125746e44dce707dd44d4f4efeea8d7e2b43aace3f8d1f235cfa2733dd"}, + {file = "numpy-1.26.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0621f7daf973d34d18b4e4bafb210bbaf1ef5e0100b5fa750bd9cde84c7ac292"}, + {file = "numpy-1.26.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51be5f8c349fdd1a5568e72713a21f518e7d6707bcf8503b528b88d33b57dc68"}, + {file = "numpy-1.26.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:767254ad364991ccfc4d81b8152912e53e103ec192d1bb4ea6b1f5a7117040be"}, + {file = "numpy-1.26.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:436c8e9a4bdeeee84e3e59614d38c3dbd3235838a877af8c211cfcac8a80b8d3"}, + {file = "numpy-1.26.0-cp310-cp310-win32.whl", hash = "sha256:c2e698cb0c6dda9372ea98a0344245ee65bdc1c9dd939cceed6bb91256837896"}, + {file = "numpy-1.26.0-cp310-cp310-win_amd64.whl", hash = "sha256:09aaee96c2cbdea95de76ecb8a586cb687d281c881f5f17bfc0fb7f5890f6b91"}, + {file = "numpy-1.26.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0792824ce2f7ea0c82ed2e4fecc29bb86bee0567a080dacaf2e0a01fe7654369"}, + {file = "numpy-1.26.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d484292eaeb3e84a51432a94f53578689ffdea3f90e10c8b203a99be5af57d8"}, + {file = "numpy-1.26.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:186ba67fad3c60dbe8a3abff3b67a91351100f2661c8e2a80364ae6279720299"}, + {file = "numpy-1.26.0.tar.gz", hash = "sha256:f93fc78fe8bf15afe2b8d6b6499f1c73953169fad1e9a8dd086cdff3190e7fdf"}, +] + +[[package]] +name = "opt-einsum" +version = "3.3.0" +requires_python = ">=3.5" +summary = "Optimizing numpys einsum function" +dependencies = [ + "numpy>=1.7", +] +files = [ + {file = "opt_einsum-3.3.0-py3-none-any.whl", hash = "sha256:2455e59e3947d3c275477df7f5205b30635e266fe6dc300e3d9f9646bfcea147"}, + {file = "opt_einsum-3.3.0.tar.gz", hash = "sha256:59f6475f77bbc37dcf7cd748519c0ec60722e91e63ca114e68821c0c54a46549"}, +] + +[[package]] +name = "scipy" +version = "1.11.3" +requires_python = "<3.13,>=3.9" +summary = "Fundamental algorithms for scientific computing in Python" +dependencies = [ + "numpy<1.28.0,>=1.21.6", +] +files = [ + {file = "scipy-1.11.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:370f569c57e1d888304052c18e58f4a927338eafdaef78613c685ca2ea0d1fa0"}, + {file = "scipy-1.11.3-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:9885e3e4f13b2bd44aaf2a1a6390a11add9f48d5295f7a592393ceb8991577a3"}, + {file = "scipy-1.11.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e04aa19acc324a1a076abb4035dabe9b64badb19f76ad9c798bde39d41025cdc"}, + {file = "scipy-1.11.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e1a8a4657673bfae1e05e1e1d6e94b0cabe5ed0c7c144c8aa7b7dbb774ce5c1"}, + {file = "scipy-1.11.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7abda0e62ef00cde826d441485e2e32fe737bdddee3324e35c0e01dee65e2a88"}, + {file = "scipy-1.11.3-cp310-cp310-win_amd64.whl", hash = "sha256:033c3fd95d55012dd1148b201b72ae854d5086d25e7c316ec9850de4fe776929"}, + {file = "scipy-1.11.3.tar.gz", hash = "sha256:bba4d955f54edd61899776bad459bf7326e14b9fa1c552181f0479cc60a568cd"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8b534fb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "LuxAI2" +version = "0.0.0" +description = "" +authors = [ + {name = "Sanggyu Lee", email = "8325289+gyusang@users.noreply.github.com"}, + {name = "Haneul Choi", email = "caelum02@snu.ac.kr"}, +] +dependencies = [ + "jaxlib @ https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.4.7+cuda11.cudnn82-cp310-cp310-manylinux2014_x86_64.whl", + "jax==0.4.7", +] +requires-python = ">=3.10,<3.11" +readme = "README.md" +license = {text = "NOLICENSE"} +