Skip to content

Commit

Permalink
added runner
Browse files Browse the repository at this point in the history
  • Loading branch information
DerrickYLJ committed Sep 10, 2023
1 parent a021f96 commit 345aeb9
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 6 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build_legion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ concurrency:
cancel-in-progress: true

jobs:
start-oraicle-instance:
runs-on: ubuntu-latest
name: Turning on Oracle VM - flexflow-ci
env:
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }}
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }}
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }}
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
OCI_INSTANCE_ID: ${{ secrets.INSTANCE_ID_FFCI }}
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3

- name: Install Oci
run: pip install oci

- name: Running script (START)
run: python3 docker/oracle_con.py --start --instance_id $OCI_INSTANCE_ID

prebuild-legion:
name: Prebuild Legion with CMake
runs-on: [self-hosted, cpu_only]
Expand Down Expand Up @@ -104,3 +124,23 @@ jobs:
TAG_NAME: ${{ env.RELEASE_DATETIME }}
GITHUB_TOKEN: ${{ secrets.FLEXFLOW_TOKEN }}
run: gh release create $TAG_NAME ./unwrapped_artifacts/*.tar.gz --repo flexflow/flexflow-third-party

close-oraicle-instance:
runs-on: ubuntu-latest
name: Turning on Oracle VM - flexflow-ci
env:
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }}
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }}
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }}
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
OCI_INSTANCE_ID: ${{ secrets.INSTANCE_ID_FFCI }}
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3

- name: Install Oci
run: pip install oci

- name: Running script (Close)
run: python3 docker/oracle_con.py --close --instance_id $OCI_INSTANCE_ID
6 changes: 3 additions & 3 deletions .github/workflows/gpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
python-interface-check:
name: Check Python Interface
runs-on: self-hosted
runs-on: [self-hosted, gpu]
defaults:
run:
shell: bash -l {0} # required to use an activated conda environment
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
inference-tests:
name: Inference Tests
runs-on: self-hosted
runs-on: [self-hosted, gpu]
defaults:
run:
shell: bash -l {0} # required to use an activated conda environment
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:

gpu-ci-flexflow:
name: Single Machine, Multiple GPUs Tests
runs-on: self-hosted
runs-on: [self-hosted, gpu]
# skip this time-consuming test for PRs to the inference branch
# if: ${{ github.event_name != 'pull_request' || github.base_ref != 'inference' }}
defaults:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/multinode-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
name: Multinode GPU Test with MPI
# Prevent Github from running the workflow on forks
if: github.repository_owner == 'flexflow'
runs-on: self-hosted
runs-on: [self-hosted, gpu]
needs: gpu-ci-concierge
# 10h timeout, instead of default of 360min (6h)
timeout-minutes: 600
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
name: Multinode GPU Test with UCX
# Prevent Github from running the workflow on forks
if: github.repository_owner == 'flexflow'
runs-on: self-hosted
runs-on: [self-hosted, gpu]
needs: gpu-ci-concierge
container:
image: ghcr.io/flexflow/flexflow-environment-cuda-11.8:latest
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
name: Multinode GPU Test with native UCX
# Prevent Github from running the workflow on forks
if: github.repository_owner == 'flexflow'
runs-on: self-hosted
runs-on: [self-hosted, gpu]
needs: gpu-ci-concierge
container:
image: ghcr.io/flexflow/flexflow-environment-cuda-11.8:latest
Expand Down
38 changes: 38 additions & 0 deletions docker/oracle_con.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import oci
import argparse
import os

parser = argparse.ArgumentParser(description="Program with optional flags")
group = parser.add_mutually_exclusive_group()
group.add_argument("--start", action="store_true", help="Start action")
group.add_argument("--stop", action="store_true", help="Stop action")
parser.add_argument("--instance_id", type=str, required=True, help="instance id required")
args = parser.parse_args()

oci_key_content = os.getenv("OCI_CLI_KEY_CONTENT")

config = {
"user": os.getenv("OCI_CLI_USER"),
"key_content": os.getenv("OCI_CLI_KEY_CONTENT"),
"fingerprint": os.getenv("OCI_CLI_FINGERPRINT"),
"tenancy": os.getenv("OCI_CLI_TENANCY"),
"region": os.getenv("OCI_CLI_REGION")
}

# Initialize the OCI configuration
# config = oci.config.from_file()
oci.config.validate_config(config)

# Initialize the ComputeClient to interact with VM instances
compute = oci.core.ComputeClient(config)

# Replace 'your_instance_id' with the actual instance ID of your VM
instance_id = args.instance_id

# Perform the action
if args.start:
# Start the VM
compute.instance_action(instance_id, "START")
else:
# Stop the VM
compute.instance_action(instance_id, "STOP")

0 comments on commit 345aeb9

Please sign in to comment.