Skip to content

Commit 94f8fd5

Browse files
Add test actions for mlc docker run (#102)
* Add test actions for mlc docker run * test commit * skip docker rm command --------- Co-authored-by: Arjun Suresh <arjun@gateoverflow.com>
1 parent b2fed45 commit 94f8fd5

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: MLC Docker core action tests
2+
3+
on:
4+
pull_request:
5+
branches: [ "main", "dev" ]
6+
paths:
7+
- '.github/workflows/test-mlc-docker-core.yml'
8+
- '**'
9+
- '!**.md'
10+
11+
jobs:
12+
test_mlc_docker_core:
13+
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.12", "3.8"]
19+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
20+
exclude:
21+
- os: windows-latest
22+
- os: macos-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v3
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Configure git longpaths (Windows)
32+
if: matrix.os == 'windows-latest'
33+
run: |
34+
git config --system core.longpaths true
35+
36+
- name: Install mlcflow from the pull request's source repository and branch
37+
run: |
38+
python -m pip install --upgrade pip
39+
python -m pip install --ignore-installed --verbose pip setuptools
40+
python -m pip install .
41+
42+
- name: Clone MLCOMMONS mlperf-automations repository
43+
run: |
44+
mlc pull repo mlcommons@mlperf-automations
45+
46+
- name: Test --docker_dt for running in detached mode
47+
run: |
48+
mlc docker run --tags=detect,os --docker_dt
49+
docker stop $(docker ps -aq)
50+
51+
- name: Test --docker_detached for running in detached mode
52+
run: |
53+
mlc docker run --tags=detect,os --docker_detached
54+
docker stop $(docker ps -aq)
55+
56+
- name: Test --docker_cache
57+
run: |
58+
mlc docker run --tags=detect,os --docker_dt --docker_cache=no
59+
60+
- name: Test --docker_rebuild
61+
run: |
62+
mlc docker run --tags=detect,os --docker_dt --docker_cache=no --docker_rebuild
63+
64+
- name: Test --dockerfile_recreate
65+
run: |
66+
mlc docker run --tags=detect,os --docker_dt --docker_cache=no --docker_rebuild --dockerfile_recreate

mlc/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,7 @@ def main():
17791779
if args.command in ['docker']:
17801780
if args.target == "run":
17811781
run_args['target'] = 'script' #allowing run to be used for docker run instead of docker script
1782+
args.target = "script"
17821783

17831784
if hasattr(args, 'details') and args.details and "," in args.details and not run_args.get("tags") and args.target in ["script", "cache"]:
17841785
run_args['tags'] = args.details

0 commit comments

Comments
 (0)