-
Notifications
You must be signed in to change notification settings - Fork 1
Pre-commit fix #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
502 commits
Select commit
Hold shift + click to select a range
e396ba8
feat: Resolve conflict, auto committed by CodeFlow
binary-husky 3df121b
Merge branch review_pxc into main
binary-husky 72dc650
remove trash and remove chinese
binary-husky 6dc5e1c
Merge branch remove_trash_and_chinese into main
pan-x-c 91f28b8
skip gpu check in debug mode
binary-husky 67f8230
improving configuration sys
binary-husky 5df0f74
renaming classes
binary-husky 236752a
Document agent performance and behavior in werewolf game
binary-husky 6c749e0
Enhance README with image and tagline
binary-husky 39eafc1
Add section on expanding Qwen2-7B to Qwen2-14B (#1)
binary-husky ef0320b
Expand Werewolves documentation with multi-agent setup (#2)
binary-husky ead443f
sync docs (#7)
binary-husky 8e5b7af
Align math & add swanlab trinity compat (#6)
binary-husky 958cfc9
add additional dataset shuffle in task reader router
binary-husky dd2bd2c
add deduplication filter (#8)
Kanaricc 299968a
merge TaskReaderRouter and TaskReaderRouterV2 into one
binary-husky e2e87bb
re-align trinity parameters
binary-husky d9755a2
fix test expectation
binary-husky daea110
improve dynamic import
binary-husky 748da76
update docs (#9)
Kanaricc bc59397
fix docs
pan-x-c 76fcdd8
fix pre-commit
pan-x-c d112987
setup unittest auto benchmarking
binary-husky 2448142
commit bad math agent
binary-husky 7cd2779
benchmark successful
binary-husky c7cf55c
connect test bot to test data server
binary-husky 31adeee
patch native rollout
binary-husky 21f6eee
simplify tool call logging
binary-husky 91c32ff
enforce ray kill in autokill
binary-husky 0031eff
Add test bot server (#12)
binary-husky 42001e4
doc update (#11)
Kanaricc 441f8f2
doc update (#16)
Kanaricc bf6a7f9
stage test bot
binary-husky dad4b05
Merge remote-tracking branch 'github/add-benchmarking-test' into add-…
binary-husky 0901263
Merge branch 'add-benchmarking-test' into dev
binary-husky 4743ed1
revert timestamp bug
binary-husky fb2ebd0
core yaml path to absolute
binary-husky 90b2252
conditional madness check
binary-husky 71e3062
improve test yaml
binary-husky cfd048f
rename vars according to @zhaoyang
binary-husky a2ae9ce
fix verl error
binary-husky db98855
Update data generation (#14)
Javkonline f4d56e8
rebase test class
binary-husky a7cc895
align trinity
binary-husky 3374079
catch import err
binary-husky f2bc644
Add support for launching Ray cluster and update benchmark tests
binary-husky d9f09d2
tune benchmark script
binary-husky 9364c4e
tutorial(countdown): add an example of countdown agent training (#19)
hehaha68 da6bf14
doc update (#21)
Kanaricc b416fb3
Add frozen lake example (#13)
pan-x-c 4bf7864
feat: add learn2ask tutorial (#20)
Kanaricc 6cdfce5
default set up to [trinity]
binary-husky 6d77eec
fix: python path in learn2ask (#24)
Kanaricc 88000c7
minimum example done (#25)
binary-husky d42e7ee
Feat: benchmark countdown (update reward_expectation) (#27)
hehaha68 a3f2c62
Benchmark learn2ask (#23)
binary-husky 5b02e33
refactor: migrate from AutoGrader to IterativeRubricsGenerator (#26)
XieLipeng0830 5018ae0
refactor: rename agentscope_execute as execute
Kanaricc b6fbd7b
refactor: rename all vars `cmt` with `tracker`
Kanaricc 11ec201
refactor: rename `llm_chat_fn` with `llm_inference_fn`
Kanaricc dc0777b
refactor: rename `obs` to `observe`, BasicContextTracker, LlmProxyFor…
Kanaricc 784c013
refactor: remove default workflow implementation
Kanaricc 5bd4d2a
refactor: rename `run_async_coro__no_matter_what` to `run_async_corou…
Kanaricc 8610b41
refactor: extract BaseAgentRunner to separate module
Kanaricc 13d4e75
refactor: rename task reader classes to follow Base prefix convention
Kanaricc 03f84a9
refactor: rename DataGeneratorBase to BaseDataGenerator to follow Bas…
Kanaricc 24d77fb
fix: fix circular import
Kanaricc cef3949
refactor: rename tracker_base_attr to base_tracker to follow Base pre…
Kanaricc 31843a7
refactor: rename `can_merge_steps` to `is_timeline_mergeable`
Kanaricc 566d143
refactor: rename `construct_alien_llm_chat_fn` to `create_external_ll…
Kanaricc 0d9ca8f
refactor: rename `VerlRolloutManger` to `VerlRolloutManager` to fix typo
Kanaricc 62e3602
refactor: rename `JudgeBase` to `BaseJudge` to follow Base prefix con…
Kanaricc 61cb3e1
refactor: rename `ASTuneRayPPOTrainer` to `ASTunerRayPPOTrainer` to f…
Kanaricc e98851b
refactor: rename `alien_llm_chat_fn` to `external_llm_fn`
Kanaricc 85f3e35
refactor: update .gitignore and add dataset display script; enhance l…
binary-husky 1e3eed8
refactor: simplify learn2ask data preprocessing with unified shell sc…
Kanaricc 5a996ef
refactor: rename `LearnProtocol` to `Workflow` for consistency
Kanaricc 3bd848b
refactor: rename `TaskReaderRouter` to `RouterTaskReader` to follow R…
Kanaricc 1f2a3ab
chore: remove duplicated code
Kanaricc 9ff0efb
refactor: rename `RandomDummyGenerator` to `RandomDummyTaskReader`
Kanaricc 3a10124
docs: update toc
Kanaricc 89b06e6
remove unnecessary utility files and add tests for compute_madness
binary-husky 417ebf6
simplify main trinity (#29)
pan-x-c 7aef5fa
[chore]: add doc for learning to ask and math agent (#31)
TaoShuchang 32ceee6
feat: add script to download and preprocess RealMedConv dataset
binary-husky 49565fa
fix: update Math Agent documentation for clarity and accuracy
binary-husky de54b73
docs: update tutorial documents (#33)
Kanaricc e858d2e
docs: minor fix
Kanaricc 7c4e252
[polish] polish math agent doc
TaoShuchang 4275055
docs: Restructure table of contents and fix language mapping
TaoShuchang ee875a8
improve tests/benchmarking
binary-husky 6be3636
docs: refactor many docs (#34)
Kanaricc 190e7a0
Learn2ask doc script (#32)
binary-husky 4807844
docs: remove duplicated toc
Kanaricc 15842ba
docs: improve workflow documentation with side-by-side code comparison
Kanaricc cef6b23
docs: typo in workflow document
Kanaricc 365e6be
docs: add debug guiding in tutorials
Kanaricc d96a499
docs: fix chinese index
Kanaricc 8553b46
docs: add brief introductions to AppWorld and Werewolves example tuto…
Kanaricc d8d5688
docs: update frozenlake tutorial
Kanaricc f29aabb
docs: Update documentation structure and assets
TaoShuchang 244aaca
docs: home page use the same page as introduction
TaoShuchang 51977e7
docs: polish task reader doc
TaoShuchang bd854ab
docs: add doc for task judger
TaoShuchang 040fe08
docs: polish introduction, align with corresponding docs
TaoShuchang 8160996
upgrade benchmark
binary-husky 569e44e
feat: add main_verl and main_vllm scripts for PPO training and chat c…
binary-husky cef0c3e
remove classic runner
binary-husky 319a52c
docs: update introduction
TaoShuchang 60caf81
docs: update intro chinese version
TaoShuchang b3b4eef
docs: minor change in workflow
Kanaricc 24882cd
docs: fix broken link in Chinese installation documentation
Kanaricc ebc18e4
Documents: Improved Task Judger, Data Pipeline, and Quick Start Guide
TaoShuchang 75d8733
docs(zh): fix markdown formatting in documentation files
TaoShuchang e5c0984
docs: polish installation
TaoShuchang 02a8982
fix: countdown
TaoShuchang d18bf80
docs: add beast-logger usage documentation
binary-husky d24d107
docs: Add training visualization documentation with SwanLab, WandB, T…
TaoShuchang caeb505
docs: refactor countdown and frozenlake tutorials
Kanaricc 54f0c43
docs: fix debug command in tutorials
Kanaricc 894d452
docs: replace "Agent" in Chinese documentation
Kanaricc 501b318
docs: fix workflow module path in tutorial configuration examples
Kanaricc 010483a
docs: enhance workflow code examples
Kanaricc 7efa53b
simplify verl backbone
binary-husky ed8c873
remove inherited methods
binary-husky 7af30b4
Fix filter datagen (#36)
Javkonline 66dd619
fix: update import paths and enhance logging configuration
binary-husky 1ce7f9c
refactor: uncomment and restore test_begin_verl method in execute_ben…
binary-husky b7032d5
rename *_trainer to trainer_*
binary-husky aec2cca
astuner/task_judge/math_answer_as_judge.py move to tutorial
binary-husky 5fb2b4d
refactor: rename RMAutoGraderJudge to AutoGraderJudge and update rela…
binary-husky 3605c5d
refactor: replace Fn with structured ReActAgent output, and convert f…
Kanaricc 6d8d090
Update example (#37)
Javkonline 3436c1f
improve deps
binary-husky 3c54e8c
feat: add astune config to SwanlabMonitor and update README for bench…
binary-husky c2ebb80
docs: update data generation documents (#35)
hehaha68 1765a3d
clean and trim code
binary-husky 4d7bd03
docs: enhance beast-logger usage instructions
binary-husky e0a3bcf
feat: integrate default configuration for AstunerJob and update mini_…
binary-husky 25de0d2
feat: update default configurations for AstunerJob and enhance YAML s…
binary-husky e6332af
rename root
binary-husky 3a37a6c
feat: add prompt tuning to future features list in README
binary-husky db26aef
feat: add launcher back
binary-husky 8f83390
feat: enhance Python environment verification
binary-husky 581df6c
docs: minor fix
Kanaricc 383b94c
explicitly disable critic init
binary-husky fbee268
docs: restructure README with improved organization and clarity
Kanaricc 44fb325
docs: replace AppWorld environment setup instructions
Kanaricc 91372d4
docs: update VSCode debug
Kanaricc 1d3c03a
docs: clarify reward scoring for conversation ending in learning to a…
Kanaricc 618f4cc
Merge branch 'cc-doc-fix1226' into pre-release
Kanaricc 17c20b4
feat: add n_gpu_for_infer parameter and validation for trinity backbo…
binary-husky 093be06
add deploy model script
binary-husky 564ee41
update benchmark probes
binary-husky 5dc54a8
improve docs
binary-husky fff9b5c
fix task loading bug
binary-husky d0237c1
update expected reward ranges in TestProbe for trinity and verl bench…
binary-husky 7cc447b
docs: update documentation files and add mkdocs configuration
XiaoBoAI d1f1788
docs: update index page styling and section title
XiaoBoAI 3534e08
add tuner v2
binary-husky 054ad28
Merge remote-tracking branch 'origin/docs/update-documentation' into …
binary-husky f386902
project name to ajet
binary-husky 8ba0d62
rename project name
binary-husky 2975931
rename project to agent-jet
binary-husky 32470f5
rename project name
binary-husky c3fb51a
rename project
binary-husky fd96251
add missing test case for benchmark_appworld in README
binary-husky f6956ac
fix appworld train yaml
binary-husky f7b1378
rename docs and add tuner v2
binary-husky c8e0bd8
adjust var names
binary-husky 26035a5
Add configuration options for timeline merging and retokenization dri…
binary-husky 995f694
consider parallel lm call in a single episode
binary-husky aac1463
doc patch
binary-husky 311fea5
discard old tuner and embrace new tuner
binary-husky ca1cf82
add interchange api
binary-husky f74d1dd
to fully async
binary-husky 6866109
imp raw http training
binary-husky 4a151c4
Enhance interchange server functionality with experiment directory su…
binary-husky f6c5453
add comment
binary-husky a66a182
Add service URL attribute to BaseGymEnv and implement DeepResearch wo…
binary-husky 62b4070
Add VSCode extension instructions for Ray Distributed Debugger and ut…
binary-husky 664098e
update docs
binary-husky a9c3c89
improve docs
binary-husky 0a9a213
feat: add finworld support and improve environment configuration
TaoShuchang 96b5071
chore(finworld): Updated the main query in ResourceKeeper to synchron…
TaoShuchang 697bc5b
feat(context_tracker): Initialize workflow_metadata to store tool sta…
TaoShuchang d05496a
fix: bugs
Kanaricc 35025aa
feat: introduce naive langchain examples
Kanaricc 8b5f090
fix: message format in agent langchain implementation
Kanaricc bb8edfe
feat: new implementation migrating learn2ask example from AgentScope …
Kanaricc 0347c80
fix: restore original code
Kanaricc cccc13f
feat: add message format converter and improve tool call handling
TaoShuchang f52d83e
feat: add trajectory saving feature with config control
TaoShuchang d930ffb
feat: add metric helpers for tool and reward statistics tracking
TaoShuchang 5003207
revise docs
binary-husky c45384c
update docs
binary-husky 34963f7
update logo
binary-husky cdecc4e
update version
binary-husky 886d7c0
Merge pull request #2 from modelscope/feat/cc/langchain-demos
Kanaricc 0e020eb
add benchmark site protection
binary-husky 7c70243
fix doc problems
binary-husky 8af0644
add logo
binary-husky 6d4849a
update docs
binary-husky 6722e2d
update README
binary-husky c00630d
fix import
binary-husky d6e47b5
langchain doc
binary-husky aa511a7
docs: add implementation examples for AgentScope, OpenAI, raw HTTP, a…
Kanaricc 7d5e623
change print to logger.log
binary-husky bdc244b
fix docs/en/tune_your_first_agent.md
binary-husky dc0769e
docs: fix typos and correct relative links in docs
Kanaricc 6144985
docs: fix typo, formatting, and relative links in docs
Kanaricc 1f9d63e
lazy init url relay client
binary-husky 1f43918
fix openai - agentscope compat
binary-husky 47c1f40
retry when ws connection failed
binary-husky f989472
extend poll second
binary-husky 78ec41d
interchange threading -> interchange subprocess
binary-husky 01bec90
currently stream output is not avail
binary-husky 9fba5d5
ws -> sse for stability
binary-husky 34d33bb
update docs
binary-husky 333c94b
fix doc url
binary-husky 9389d31
minor css adjustment
binary-husky b548324
Merge branch 'main' into dev/shuchang
binary-husky 836e380
refactor: clean up unused imports and add text extraction method in M…
binary-husky 5977031
revise commit
binary-husky c10e96a
refactor(utils): remove meesage trasformation between OpenAI, AgentScope
TaoShuchang a7dc96d
amend config gap
binary-husky 69ca4d8
update benchmark test robot
binary-husky a23a867
Merge pull request #1 from modelscope/dev/shuchang
binary-husky 9e62b88
remove user_workflow reference and increase robustness
binary-husky c8efc5e
refactor(gc): use a lock for garbage collection in BaseAgentRunner
binary-husky 855cb2f
redis
binary-husky fc0a680
maybe stable
binary-husky 1da86e2
fix ctrl + c exit problem
binary-husky 2c05d11
optimize parallel performance with zmq
binary-husky 8eae43c
optimize further
binary-husky 75a4321
update yaml configuration
binary-husky 666e8d3
fix interchange server boot
binary-husky d0b6cae
httpx aclose patch
binary-husky 0782173
keyurl multinode training support
binary-husky afeb5ed
fix trinity baseurl support
binary-husky d02bf54
refactor: update documentation deployment process and remove obsolete…
binary-husky 394b278
fix mkdocs auto build
binary-husky 1ff504d
refactor: streamline MkDocs deployment workflow and update Python ver…
binary-husky 6906d3a
fix: correct site_url in mkdocs configuration
binary-husky c7f15db
fix: update documentation links to point to the new modelscope URLs
binary-husky 0142ccf
docs: add citation section to README for research reference
binary-husky 0b13540
fix invalid urls
binary-husky 9d0c77e
remove trailing-whitespace
binary-husky 0dfbc58
update doc: platform compare
binary-husky 576bc48
stage
binary-husky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,62 @@ | ||
| name: Deploy MkDocs to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Cache pip dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install -r docs/requirements.txt | ||
|
|
||
| - name: Build documentation | ||
| run: mkdocs build --clean | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: ./site | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
This file contains hidden or 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,67 @@ | ||
| # | ||
| name: Create and publish a Docker image | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: 'The git ref (branch or tag) to build the Docker image from.' | ||
| required: true | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository }} | ||
|
|
||
| jobs: | ||
| build-and-push-image: | ||
| runs-on: self-hosted | ||
| timeout-minutes: 240 # wait up to 4 hours | ||
| # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| attestations: write | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. | ||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. | ||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=match,pattern=\d.\d.\d | ||
| type=sha | ||
| # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. | ||
| # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository. | ||
| # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. | ||
| - name: Build and push Docker image | ||
| id: push | ||
| uses: docker/build-push-action@v4 | ||
| with: | ||
| context: . | ||
| push: true | ||
| file: scripts/docker/dockerfile | ||
| shm-size: 64g | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
|
|
||
| # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). | ||
| - name: Generate artifact attestation | ||
| uses: actions/attest-build-provenance@v3 | ||
| with: | ||
| subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
| subject-digest: ${{ steps.push.outputs.digest }} | ||
| push-to-registry: true |
This file contains hidden or 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,26 @@ | ||
| services: | ||
|
|
||
| ajet-node-1: | ||
| image: agentjet-unittest:latest | ||
| pull_policy: never | ||
| command: bash -c "uv pip install -e .[trinity] && ray start --head --dashboard-host 0.0.0.0 --include-dashboard true --block" | ||
| environment: | ||
| - PATH=/opt/venv/bin:$PATH | ||
| - HF_ENDPOINT=https://hf-mirror.com | ||
| - RAY_ADDRESS=auto | ||
| working_dir: /workspace | ||
| volumes: | ||
| - ajet-volume:/mnt | ||
| - ../../..:/workspace | ||
| shm_size: "64G" | ||
| deploy: | ||
| resources: | ||
| reservations: | ||
| devices: | ||
| - driver: nvidia | ||
| device_ids: ['0', '1', '2', '3'] | ||
| capabilities: [gpu] | ||
|
|
||
| volumes: | ||
| ajet-volume: | ||
| external: true |
This file contains hidden or 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,13 @@ | ||
| name: pre-commit | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.10' | ||
| - uses: pre-commit/action@v3.0.0 |
This file contains hidden or 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,111 @@ | ||
| name: unittest | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| checks: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| unittest: | ||
| # only run on pull request | ||
| if: ${{ github.event.issue.pull_request && (startsWith(github.event.comment.body, '/unittest')) && github.event.comment.author_association == 'COLLABORATOR' }} | ||
| runs-on: self-hosted | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| path: ajet-${{ github.run_id }} | ||
| ref: refs/pull/${{ github.event.issue.number }}/head | ||
|
|
||
| - name: Setup docker compose | ||
| working-directory: ajet-${{ github.run_id }}/.github/workflows/docker | ||
| run: | | ||
| docker compose up -d | ||
| sleep 15s | ||
|
|
||
| - name: Check ray status | ||
| working-directory: ajet-${{ github.run_id }}/.github/workflows/docker | ||
| run: | | ||
| MAX_RETRIES=20 | ||
| RETRY_INTERVAL=5 | ||
| for i in $(seq 1 $MAX_RETRIES); do | ||
| docker compose exec ajet-node-1 ray status && docker compose exec ajet-node-2 ray status && break | ||
| echo "Waiting for ray cluster to be ready... ($i/$MAX_RETRIES)" | ||
| sleep $RETRY_INTERVAL | ||
| if [ "$i" -eq "$MAX_RETRIES" ]; then | ||
| echo "Ray cluster failed to start after $MAX_RETRIES retries." | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| - name: Decide test type | ||
| id: test_type | ||
| working-directory: ajet-${{ github.run_id }} | ||
| run: | | ||
| COMMENT="${{ github.event.comment.body }}" | ||
| if [[ "$COMMENT" == "/unittest"* ]]; then | ||
| echo "type=all" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Run unittest | ||
| working-directory: ajet-${{ github.run_id }}/.github/workflows/docker | ||
| run: | | ||
| TYPE="${{ steps.test_type.outputs.type }}" | ||
| if [ "$TYPE" = "all" ]; then | ||
| echo "tests_run=true" >> $GITHUB_ENV | ||
| docker compose exec ajet-node-1 pytest tests -v -s --ctrf report.json | ||
| fi | ||
|
|
||
| - name: Convert report.json time to ms | ||
| working-directory: ajet-${{ github.run_id }} | ||
| if: env.tests_run == 'true' || failure() | ||
| run: | | ||
| REPORT=report.json | ||
| if [ -f "$REPORT" ]; then | ||
| jq '(.results.tests[] | .duration, .start, .stop) |= (. * 1000) | (.results.summary.start, .results.summary.stop) |= (. * 1000)' "$REPORT" > "$REPORT.tmp" && mv "$REPORT.tmp" "$REPORT" | ||
| fi | ||
|
|
||
| - name: Clean checkpoint dir | ||
| working-directory: ajet-${{ github.run_id }}/.github/workflows/docker | ||
| if: always() | ||
| run: | | ||
| docker compose exec ajet-node-1 rm -rf /mnt/checkpoints/* | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload test results | ||
| if: env.tests_run == 'true' || failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pytest-results | ||
| path: ajet-${{ github.run_id }}/report.json | ||
| continue-on-error: true | ||
|
|
||
| - name: Publish Test Report | ||
| if: env.tests_run == 'true' || failure() | ||
| uses: ctrf-io/github-test-reporter@v1 | ||
| with: | ||
| report-path: ajet-${{ github.run_id }}/report.json | ||
| summary: true | ||
| pull-request: false | ||
| issue: ${{ github.event.issue.number }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| continue-on-error: true | ||
|
|
||
| - name: Remove docker compose | ||
| working-directory: ajet-${{ github.run_id }}/.github/workflows/docker | ||
| if: always() | ||
| run: | | ||
| docker compose down --remove-orphans | ||
| continue-on-error: true | ||
|
|
||
| - name: Cleanup workspace | ||
| if: always() | ||
| run: | | ||
| rm -rf ajet-${{ github.run_id }} 2>/dev/null | ||
| continue-on-error: true |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,55 @@ | ||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: "v0.11.4" | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: ruff | ||
| args: ["--fix", "--show-fixes", "--output-format=full"] | ||
| exclude: ^.*\.(ipynb)$ | ||
| - id: ruff-format | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-added-large-files | ||
| - id: check-ast | ||
| - id: check-json | ||
| - id: check-merge-conflict | ||
| - id: detect-private-key | ||
|
|
||
| - repo: https://github.com/psf/black | ||
| rev: 23.7.0 | ||
| hooks: | ||
| - id: black | ||
| language_version: python3.10 | ||
| args: [--line-length=999999] | ||
|
|
||
| # - repo: https://github.com/pycqa/isort | ||
| # rev: 5.12.0 | ||
| # hooks: | ||
| # - id: isort | ||
| # args: ["--profile", "black", "--filter-files"] | ||
|
|
||
| # - repo: https://github.com/pycqa/flake8 | ||
| # rev: 6.1.0 | ||
| # hooks: | ||
| # - id: flake8 | ||
| # additional_dependencies: [flake8-docstrings] | ||
| # args: [ | ||
| # "--max-line-length=100", | ||
| # "--max-complexity=20", | ||
| # "--select=C,E,F,W,B,B950", | ||
| # "--ignore=E203,E266,E501,W503", | ||
| # ] | ||
|
|
||
| # - repo: https://github.com/pre-commit/mirrors-mypy | ||
| # rev: v1.7.0 | ||
| # hooks: | ||
| # - id: mypy | ||
| # args: [ | ||
| # --ignore-missing-imports, | ||
| # --disable-error-code=var-annotated, | ||
| # --disable-error-code=union-attr, | ||
| # --disable-error-code=no-redef, | ||
| # --disable-error-code=assignment, | ||
| # --disable-error-code=has-type, | ||
| # --disable-error-code=attr-defined, | ||
| # --disable-error-code=import-untyped, | ||
| # --disable-error-code=truthy-function, | ||
| # --follow-imports=skip, | ||
| # --explicit-package-bases, | ||
| # ] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the line length to an extremely high value like
999999effectively disables line length checking. This can lead to code that is difficult to read and review. It's a standard practice to enforce a reasonable line length to ensure code consistency and maintainability. I recommend setting this to a more conventional value, such as 120.