From a67ec5ba017a49fd2d4350d8ae0ab83ebf8fb9a0 Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 2 Jul 2025 18:54:49 +0800 Subject: [PATCH] chore: add devcontainer Dockerfile, devcontainer.json, and env (#997) * chore: add devcontainer Dockerfile, devcontainer.json, and env * style: remove unnecessary comment on ENABLE_CACHE setting * docs: add internal devcontainer README with setup instructions * Update README in .devcontainer based on PR #997 --------- Co-authored-by: jingyuanlm <842442862@qq.com> --- .devcontainer/Dockerfile | 10 +++++++ .devcontainer/README.md | 30 +++++++++++++++++++++ .devcontainer/devcontainer.json | 29 ++++++++++++++++++++ .devcontainer/env | 47 +++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/README.md create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/env diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..d4d79f68 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,10 @@ +# 1. Pull down your Azure Container Registry image +FROM rdagentappregistry.azurecr.io/rd-agent-mle:20250623 + +# 2. (Optional) install any additional tools you need +# e.g. git, bash-completion, etc. +# RUN apt update && \ +# apt install -y git bash-completion && \ +# rm -rf /var/lib/apt/lists/* +RUN apt update && \ + apt install -y git bash-completion diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 00000000..b48a4e09 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,30 @@ +# Introduction + +!!!!!This dev container is not for public development!!!!!! +!!!!!Please don't use it if you are just a public open-source user.!!!!!! + +# Steps to run the dev container (for internal use only) + +Prerequisites(this is the reason why this dev container is not for public use): + +- Make sure you have the `rdagentappregistry.azurecr.io/rd-agent-mle:20250623` image locally & DevContainer is installed in your IDE +- The kaggle dataset is located at `/home/shared/RD-Agent/kaggle` + +1. Open the project and select "Open In DevContainer" +2. Set up your Kaggle Key (do not share this; other internal URLs are hardcoded in the config files) + +```bash +export KAGGLE_USERNAME= +export KAGGLE_KEY= +``` + +3. Run: python rdagent/app/data_science/loop.py --competition nomad2018-predict-transparent-conductors + + +# Additional Notes +- Please install and use this Dev Container in VS Code. +- You **must open VS Code remotely and enter the `RD-Agent` directory before running the DevContainer configuration (`.devcontainer/devcontainer.json`)**. Otherwise, the workspace and path mappings will not work as expected. +- To open the DevContainer correctly in VS Code: + 1. Remotely connect to the machine and open the `RD-Agent` folder in VS Code. + 2. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac), type and select **"Dev Containers: Reopen in Container"**. + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..44ab731a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "rd-agent-mle DevContainer", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "workspaceFolder": "/workspace/RD-Agent", + "workspaceMount": "source=${localWorkspaceFolder},target=/workspace/RD-Agent,type=bind,consistency=cached", + "remoteUser": "root", + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "mounts": [ + "source=/home/shared/RD-Agent/kaggle,target=/home/shared/RD-Agent/kaggle,type=bind,consistency=cached,readonly" + ], + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-toolsai.jupyter" + ], + "runArgs": [ + "--init", + "--shm-size=1g", + "--env-file", "${localWorkspaceFolder}/.devcontainer/env", + "--network=host", + "--gpus=all" + ], + "postCreateCommand": "make dev" +} diff --git a/.devcontainer/env b/.devcontainer/env new file mode 100644 index 00000000..455df7fb --- /dev/null +++ b/.devcontainer/env @@ -0,0 +1,47 @@ +# Global configs: + +MAX_RETRY=12000 +RETRY_WAIT_SECONDS=5 +TIMEOUT_FAIL_LIMIT=100 + +# litellm +# CHAT_MODEL=gpt-4o +# CHAT_TEMPERATURE=0.7 + +CHAT_STREAM=False +CHAT_TEMPERATURE=1 +CHAT_MODEL=o1-preview +SYSTEM_PROMPT_ROLE=user + +BACKEND=rdagent.oai.backend.LiteLLMAPIBackend +OPENAI_API_KEY=sk-1234 +OPENAI_API_BASE=http://ep14.213428.xyz:38881 + + +# amc chat model configs: +EMBEDDING_MODEL=text-embedding-ada-002 + +# Cache Setting (Optional): +DUMP_CHAT_CACHE=True +USE_CHAT_CACHE=False +DUMP_EMBEDDING_CACHE=True +USE_EMBEDDING_CACHE=False +LOG_LLM_CHAT_CONTENT=True + +DS_LOCAL_DATA_PATH=/home/shared/RD-Agent/kaggle + +DS_IF_USING_MLE_DATA=True + + +PICKLE_CACHE_FOLDER_PATH_STR=./log/pickle_cache +CACHE_WITH_PICKLE=False +ENABLE_CACHE=False +PROMPT_CACHE_PATH=./log/prompt_cache.db + +DS_CODER_COSTEER_ENV_TYPE=conda +DS_PROPOSAL_VERSION=v2 + +DS_CODER_ON_WHOLE_PIPELINE=True +COSTEER_V2_QUERY_FORMER_TRACE_LIMIT=3 + +# export PYTHONPATH=. # this is for running researcher branch;