https://github.com/agnostiqhq/covalent-awsbatch-plugin

Executor plugin interfacing Covalent with AWS Batch

https://github.com/agnostiqhq/covalent-awsbatch-plugin

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary

Keywords

aws-batch batch-processing cloud-computing covalent docker elastic-container-registry etl parallelization pipelines python python3 workflow

Keywords from Contributors

quantum-computing quantum quantum-machine-learning data-pipeline workflow-automation workflow-management orchestration machinelearning-python hpc-applications braket
Last synced: 5 months ago · JSON representation

Repository

Executor plugin interfacing Covalent with AWS Batch

Basic Info
  • Host: GitHub
  • Owner: AgnostiqHQ
  • License: apache-2.0
  • Language: Python
  • Default Branch: develop
  • Homepage: https://agnostiq.ai/covalent
  • Size: 479 KB
Statistics
  • Stars: 11
  • Watchers: 9
  • Forks: 2
  • Open Issues: 9
  • Releases: 31
Topics
aws-batch batch-processing cloud-computing covalent docker elastic-container-registry etl parallelization pipelines python python3 workflow
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

 

[![covalent](https://img.shields.io/badge/covalent-0.177.0-purple)](https://github.com/AgnostiqHQ/covalent) [![python](https://img.shields.io/pypi/pyversions/covalent-awsbatch-plugin)](https://github.com/AgnostiqHQ/covalent-awsbatch-plugin) [![tests](https://github.com/AgnostiqHQ/covalent-awsbatch-plugin/actions/workflows/tests.yml/badge.svg)](https://github.com/AgnostiqHQ/covalent-awsbatch-plugin/actions/workflows/tests.yml) [![codecov](https://codecov.io/gh/AgnostiqHQ/covalent-awsbatch-plugin/branch/main/graph/badge.svg?token=QNTR18SR5H)](https://codecov.io/gh/AgnostiqHQ/covalent-awsbatch-plugin) [![apache](https://img.shields.io/badge/License-Apache_License_2.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)

Covalent AWS Batch Plugin

Covalent is a Pythonic workflow tool used to execute tasks on advanced computing hardware.

This executor plugin interfaces Covalent with AWS Batch which allows tasks in a covalent workflow to be executed as AWS batch jobs.

1. Installation

To use this plugin with Covalent, simply install it using pip:

pip install covalent-awsbatch-plugin

2. Usage Example

This is an example of how a workflow can be adapted to utilize the AWS Batch Executor. Here we train a simple Support Vector Machine (SVM) model and use an existing AWS Batch Compute environment to run the train_svm electron as a batch job. We also note we require DepsPip to install the dependencies when creating the batch job.

```python from numpy.random import permutation from sklearn import svm, datasets import covalent as ct

deps_pip = ct.DepsPip( packages=["numpy==1.23.2", "scikit-learn==1.1.2"] )

executor = ct.executor.AWSBatchExecutor( s3bucketname = "covalent-batch-qa-job-resources", batchqueue = "covalent-batch-qa-queue", batchexecutionrolename = "ecsTaskExecutionRole", batchjobrolename = "covalent-batch-qa-job-role", batchjobloggroupname = "covalent-batch-qa-log-group", vcpu = 2, # Number of vCPUs to allocate memory = 3.75, # Memory in GB to allocate timelimit = 300, # Time limit of job in seconds )

Use executor plugin to train our SVM model.

@ct.electron( executor=executor, depspip=depspip ) def train_svm(data, C, gamma): X, y = data clf = svm.SVC(C=C, gamma=gamma) clf.fit(X[90:], y[90:]) return clf

@ct.electron def loaddata(): iris = datasets.loadiris() perm = permutation(iris.target.size) iris.data = iris.data[perm] iris.target = iris.target[perm] return iris.data, iris.target

@ct.electron def scoresvm(data, clf): Xtest, ytest = data return clf.score( Xtest[:90], y_test[:90] )

@ct.lattice def runexperiment(C=1.0, gamma=0.7): data = loaddata() clf = trainsvm( data=data, C=C, gamma=gamma ) score = scoresvm( data=data, clf=clf ) return score

Dispatch the workflow

dispatchid = ct.dispatch(runexperiment)( C=1.0, gamma=0.7 )

Wait for our result and get result value

result = ct.getresult(dispatchid=dispatch_id, wait=True).result

print(result) ```

During the execution of the workflow one can navigate to the UI to see the status of the workflow, once completed however the above script should also output a value with the score of our model.

0.9777777777777777

3. Configuration

There are many configuration options that can be passed in to the class ct.executor.AWSBatchExecutor or by modifying the covalent config file under the section [executors.awsbatch]

For more information about all of the possible configuration values visit our read the docs (RTD) guide for this plugin.

4. Required AWS Resources

In order to run your workflows with covalent there are a few notable AWS resources that need to be provisioned first.

For more information regarding which cloud resources need to be provisioned visit our read the docs (RTD) guide for this plugin.

The required AWS resources include a Batch Job Definition, Batch Job Role, Batch Queue, Batch Compute Environment, Log Group, Subnet, VPC, and an S3 Bucket.

Getting Started with Covalent

For more information on how to get started with Covalent, check out the project homepage and the official documentation.

Release Notes

Release notes for this plugin are available in the Changelog.

Citation

Please use the following citation in any publications:

W. J. Cunningham, S. K. Radha, F. Hasan, J. Kanem, S. W. Neagle, and S. Sanand. Covalent. Zenodo, 2022. https://doi.org/10.5281/zenodo.5903364

License

Covalent is licensed under the Apache License 2.0. See the LICENSE file or contact the support team for more details.

Owner

  • Name: Agnostiq
  • Login: AgnostiqHQ
  • Kind: organization
  • Email: contact@agnostiq.ai
  • Location: Toronto

Developing Software for Advanced Computing

GitHub Events

Total
  • Push event: 4
Last Year
  • Push event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 100
  • Total Committers: 13
  • Avg Commits per committer: 7.692
  • Development Distribution Score (DDS): 0.59
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
CovalentOpsBot c****t 41
Faiyaz Hasan f****1@g****m 18
Alejandro Esquivel ae@a****d 18
Will Cunningham w****7 8
Venkat Bala v****t@a****i 3
mpvgithub 1****b 2
WingCode s****4@g****m 2
Sankalp Sanand s****p@a****i 2
Ara Ghukasyan 3****s 2
pre-commit-ci[bot] 6****] 1
jkanem j****m@g****m 1
Scott Wyman Neagle w****a@p****m 1
FilipBolt f****t@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 28
  • Total pull requests: 61
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 7 days
  • Total issue authors: 9
  • Total pull request authors: 13
  • Average comments per issue: 0.43
  • Average comments per pull request: 0.9
  • Merged pull requests: 55
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • AlejandroEsquivel (8)
  • kessler-frost (4)
  • scottwn (4)
  • FyzHsn (3)
  • cjao (2)
  • araghukas (2)
  • Emmanuel289 (2)
  • venkatBala (2)
  • jkanem (1)
Pull Request Authors
  • FyzHsn (20)
  • AlejandroEsquivel (18)
  • venkatBala (5)
  • wjcunningham7 (4)
  • araghukas (2)
  • mpvgithub (2)
  • kessler-frost (2)
  • dependabot[bot] (2)
  • pre-commit-ci[bot] (2)
  • FilipBolt (1)
  • WingCode (1)
  • jkanem (1)
  • scottwn (1)
Top Labels
Issue Labels
Team West (2) Epic (2) improvements / runtime (1) testing / validation (1) east (1) devops (1) testing / integration tests (1) testing / unit tests (1) docs (1) good first issue (1) unitaryhack-bounty (1)
Pull Request Labels
dependencies (2) Team West (1) improvements / style (1) unitaryhack-accepted (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 60 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 34
  • Total maintainers: 1
pypi.org: covalent-awsbatch-plugin

Covalent AWS Batch Plugin

  • Versions: 34
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 60 Last month
Rankings
Dependent packages count: 10.1%
Downloads: 11.9%
Average: 16.0%
Stargazers count: 17.1%
Forks count: 19.1%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/changelog_reminder.yml actions
  • actions/checkout master composite
  • peterjgrainger/action-changelog-reminder v1.3.0 composite
.github/workflows/license.yml actions
  • actions/checkout v3 composite
  • pilosus/action-pip-license-checker main composite
.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • ncipollo/release-action v1 composite
.github/workflows/tests.yml actions
  • actions-ecosystem/action-get-latest-tag v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v3 composite
.github/workflows/version.yml actions
  • actions/checkout v1 composite
  • tj-actions/changed-files v18.4 composite
tests/functional_tests/requirements.txt pypi
  • numpy ==1.23.2 test
  • python-dotenv ==0.21.0 test
  • scikit-learn ==1.1.2 test
.github/workflows/changelog.yml actions
  • EndBug/add-and-commit v9 composite
  • actions/checkout v3 composite
requirements.txt pypi
  • boto3 ==1.20.48
  • covalent ==0.177.0rc0
  • docker ==5.0.3
tests/requirements.txt pypi
  • pytest ==6.2.5 test
  • pytest-mock ==3.6.1 test
pyproject.toml pypi
setup.py pypi