Skip to content

Commit

Permalink
build test image
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnXuan committed Nov 9, 2023
1 parent 1653725 commit 25c438c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test branch or PR
on:
push:
branches:
- 'dev_test_workflow'
workflow_dispatch:

concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true

env:
CO_MODELS_SRC: CoModels
TEST_DIR: test_dir
TEST_IMG_TAG: registry.cn-beijing.aliyuncs.com/oneflow/manylinux2014_x86_64_cuda12.2:bba403da5da597c3f7905dfc52b24989ee21ffb1
TEST_CONTAINER_NAME: co_models_test

jobs:
build_job:
name: build test image
runs-on: [self-hosted]
steps:
- name: Checkout CoModels branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
path: ${{ env.CO_MODELS_SRC}}
- name: build image
run: |
cd ${{ env.CO_MODELS_SRC}}
bash docker/build.sh
9 changes: 3 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
types: [opened, review_requested, ready_for_review, synchronize, unlocked]
merge_group:
types: [checks_requested]
push:
branches:
- 'dev_test_workflow'
#push:
# branches:
# - 'dev_test_workflow'
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -68,9 +68,6 @@ jobs:
#if: ${{ !fromJson(matrix.cache-hit) && contains(matrix.runs-on, 'self-hosted') }}
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} ls
- name: Test container1
#if: ${{ !fromJson(matrix.cache-hit) && contains(matrix.runs-on, 'self-hosted') }}
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} python3 -m pip list
- name: Install OneFlow
#if: ${{ !fromJson(matrix.cache-hit) && contains(matrix.runs-on, 'self-hosted') }}
Expand Down
3 changes: 3 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker build \
--rm \
-t comodels_test -f docker/test_dockerfile .
9 changes: 9 additions & 0 deletions docker/test_dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM registry.cn-beijing.aliyuncs.com/oneflow/oneflow:nightly-cuda11.8


#RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package Pillow==9.5.0 numpy==1.21.6 opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8
RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8 tabulate==0.9.0
RUN apt update && apt install -y git
RUN git clone https://github.com/Oneflow-Inc/vision.git \
&& cd vision \
&& python3 -m pip install -e .

0 comments on commit 25c438c

Please sign in to comment.