Skip to content

Commit

Permalink
Add azure integration test (mosaicml#2996)
Browse files Browse the repository at this point in the history
* add cpu test

* new test file

* fix
  • Loading branch information
mvpatel2000 authored Feb 12, 2024
1 parent 6ff3041 commit 6d4575d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 107 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:
code-eval-apikey: ${{ secrets.CODE_EVAL_APIKEY }}
gcs-key: ${{ secrets.GCS_KEY }}
gcs-secret: ${{ secrets.GCS_SECRET }}
azure-account-name: ${{ secrets.AZURE_ACCOUNT_NAME }}
azure-account-access-key: ${{ secrets.AZURE_ACCOUNT_ACCESS_KEY }}
coverage:
uses: ./.github/workflows/coverage.yaml
name: Coverage Results
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pytest-cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ on:
required: false
gcs-secret:
required: false
azure-account-name:
required: false
azure-account-access-key:
required: false
jobs:
pytest-cpu:
timeout-minutes: 30
Expand Down Expand Up @@ -75,6 +79,8 @@ jobs:
export CODE_EVAL_APIKEY='${{ secrets.code-eval-apikey }}'
export GCS_KEY='${{ secrets.gcs-key }}'
export GCS_SECRET='${{ secrets.gcs-secret }}'
export AZURE_ACCOUNT_NAME='${{ secrets.azure-account-name }}'
export AZURE_ACCOUNT_ACCESS_KEY='${{ secrets.azure-account-access-key }}'
export S3_BUCKET='${{ inputs.pytest-s3-bucket }}'
export COMMON_ARGS="-v --durations=20 -m '${{ inputs.pytest-markers }}' --s3_bucket '$S3_BUCKET' \
-o tmp_path_retention_policy=none"
Expand Down
33 changes: 33 additions & 0 deletions tests/utils/object_store/test_azure_object_store.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

import pytest
from torch.utils.data import DataLoader

from composer.trainer import Trainer
from tests.common import RandomClassificationDataset, SimpleModel


@pytest.mark.remote
def test_azure_object_store_integration():
model = SimpleModel()
train_dataloader = DataLoader(dataset=RandomClassificationDataset())
trainer_save = Trainer(
model=model,
train_dataloader=train_dataloader,
save_folder='azure://mosaicml-composer-tests/checkpoints/{run_name}',
save_filename='test-model.pt',
max_duration='1ba',
)
run_name = trainer_save.state.run_name
trainer_save.fit()
trainer_save.close()

trainer_load = Trainer(
model=model,
train_dataloader=train_dataloader,
load_path=f'azure://mosaicml-composer-tests/checkpoints/{run_name}/test-model.pt',
max_duration='2ba',
)
trainer_load.fit()
trainer_load.close()
107 changes: 0 additions & 107 deletions tests/utils/object_store/test_integration_gs_object_store.py

This file was deleted.

0 comments on commit 6d4575d

Please sign in to comment.