
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
A place for Agora's ETL, data testing, and data analysis
This configuration-driven data pipeline uses a config file - which is easy for
engineers, analysts, and project managers to understand - to drive the entire ETL process. The code in src/agoradatatools uses
parameters defined in a config file to determine which kinds of extraction and transformations a particular
dataset needs to go through before the resulting data is serialized as json files that can be loaded into Agora's data repository.
In the spirit of importing datasets with the minimum amount of transformations, one can simply add a dataset to the config file, and run the scripts.
This src/agoradatatools implementation was influenced by the "Modern Config Driven ELT Framework for Building a
Data Lake" talk given at the Data + AI Summit of 2021.
Python notebooks that describe the custom logic for various datasets are located in /data_analysis/notebooks.
The json files generated by src/agoradatatools are written to folders in the Agora Synapse project by default,
although you can modify the destination Synapse folder in the config file.
Note that running the pipeline does not automatically update the Agora database in any environment. Ingestion of generated json files into the Agora databases is handled by https://github.com/Sage-Bionetworks/agora-data-manager/.
You can run the pipeline in any of the following ways:
When running the pipeline, you must specify the config file that will be used. There are two config files that are checked into this repo:
test_config.yaml places the transformed datasets in the Agora Testing Data folder in synapse; write files to this folder to perform data validation.config.yaml places the transformed datasets the Agora Live Data synapse folder; write files to this folder once you've validated that the ETL process is generating files suitable for release.
Note that files in the Agora Live Data folder are not automatically released, so if 'bad' file versions do get written to this folder it's not the end of the world. A releasable manifest file can be generated by a subsequent ETL processing run into the folder, or manually if necessary.You may also create a custom config file to use locally to target specific dataset(s) or transforms of interest, and/or to write the generated json files to a different Synapse location. See the config file section for additional information.
This pipeline can be executed without any local installation, permissions, or credentials; the Sage Bionetworks Nextflow Tower workspace is configured to use Agora's Synapse credentials, which can be found in LastPass in the "Shared-Agora" Folder.
The instructions to trigger the workflow can be found at https://github.com/Sage-Bionetworks-Workflows/nf-agora
Your configured Synapse credentials can be used to run this package both locally and using Docker, as outlined below.
Perform the following one-time steps to set up your local environment and to obtain the required Synapse permissions:
This package uses Python, if you have not already, please install https://github.com/pyenv/pyenv#installation to manage your Python versions. Versions supported by this package are all versions >=3.7 and <3.11. If you do not install pyenv make sure that Python and pip are installed correctly and have been added to your PATH by running python3 --version and pip3 --version. If your installation was successful, your terminal will return the versions of Python and pip that you installed. Note: If you have pyenv it will install a specific version of Python for you.
Install pipenv by running pip install pipenv.
Install git if you have not done so already using https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
Clone this Github Repository to your local machine by opening your terminal, navigating to the directory that you want this repository to be cloned and running git clone https://github.com/Sage-Bionetworks/agora-data-tools.git. After cloning is complete, navigate into the newly created agora-data-tools directory.
Install agoradatatools locally using pipenv:
bashpipenv install # To develop locally you want to add --dev # pipenv install --dev pipenv shell
You can check if the package was isntalled correctly by running adt --help in the terminal. If it returns instructions about how to use the CLI, installation was successful and you can run the pipeline by providing the desired config file as an argument. The following example command will execute the pipeline using test_config.yaml:
bashadt test_config.yaml
There is a publicly available https://hub.docker.com/r/sagebionetworks/agora-data-tools automatically built via DockerHub. That said, you may want to develop using Docker locally on a feature branch.
If you don't want to deal with Python paths and dependencies, you can use Docker to run the pipeline. Perform the following one-time step to set up your docker environment and to obtain the required Synapse permissions:
Once you have completed the one-time setup step outlined above, execute the pipeline by running the following command and providing your PAT and the desired config file as an argument. The following example command will execute the pipeline in Docker using test_config.yaml:
# This creates a local docker image docker build -t agora-data-tools . docker run -e SYNAPSE_AUTH_TOKEN=<your PAT> agora-data-tools adt test_config.yaml
In order to test the GitHub Actions workflow locally:
Then run:
bashact -v --secret-file .secrets
The repository is currently using Agora's credentials for Synapse. Those can be found in LastPass in the "Shared-Agora" Folder.
Unit tests can be run by calling pytest from the command line.
bashpython -m pytest
Parameters:
destination: Defines the default target location (folder) that the generated json files are written to; this value can be overridden on a per-dataset basisdatasets/<dataset>: Each generated json file is named <dataset>.jsondatasets/<dataset>/files: A list of source files for the dataset
name: The name of the source file (this name is the reference the code will use to retrieve a file from the configuration)id: Synapse id of the fileformat: The format of the source filedatasets/<dataset>/provenance: The Synapse id of each entity that the dataset is derived from, used to populate the generated file's Synapse provenance. (The Synapse API calls this "Activity")datasets/<dataset>/destination: Override the default destination for a specific dataset by specifying a synID, or use *dest to use the default destinationdatasets/<dataset>/column_rename: Columns to be renamed prior to data transformationdatasets/<dataset>/agora_rename: Columns to be renamed after data transformation, but prior to json serializationdatasets/<dataset>/custom_transformations: The list of additional transformations to apply to the dataset; a value of 1 indicates the default transformation您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务