Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for making this plugin work with stable covalent #77

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
with:
persist-credentials: false
fetch-depth: 0
ref: further-fixes-for-release

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir --upgrade \
amazon-braket-pennylane-plugin==1.6.9 \
boto3==1.20.48 \
pennylane==0.24.0 \
RUN pip install --no-cache-dir \
boto3==1.28.5 \
pennylane==0.31.1 \
amazon-braket-pennylane-plugin==1.17.4 \
sagemaker-training

RUN if [ -z "$PRE_RELEASE" ]; then \
Expand Down
4 changes: 2 additions & 2 deletions covalent_braket_plugin/assets/infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "aws_s3_bucket" "braket_bucket" {
}

resource "aws_ecr_repository" "braket_ecr_repo" {
name = "${var.name}-base-executor-repo"
name = "amazon-braket-${var.name}-base-executor-repo"
image_tag_mutability = "MUTABLE"

force_delete = true
Expand All @@ -41,7 +41,7 @@ resource "aws_ecr_repository" "braket_ecr_repo" {
}

resource "aws_iam_role" "braket_iam_role" {
name = "${var.name}-role"
name = "amazon-braket-${var.name}-role"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
Expand Down
5 changes: 3 additions & 2 deletions covalent_braket_plugin/assets/infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Prefix this "name" with something unique for your deployment
# Prefix this "name" with something unique for your deployment.
# This is used in addition to the `amazon-braket` prefix to ensure uniqueness, for e.g. the full name will be `amazon-braket-<name>-bucket` for S3 bucket name.
variable "name" {
default = "covalent-braket"
default = "sankalp-covalent"
description = "Name to be used in the new provisioned resources"
}

Expand Down
13 changes: 5 additions & 8 deletions covalent_braket_plugin/braket.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@
import tempfile
from functools import partial
from pathlib import Path
from typing import Any, Callable, Dict, List, Tuple
from typing import Any, Callable, Dict, List

import boto3
import botocore
import cloudpickle as pickle
from covalent._shared_files.config import get_config
from covalent._shared_files.exceptions import TaskCancelledError
from covalent._shared_files.logger import app_log
from covalent._workflow.transport import TransportableObject
from covalent_aws_plugins import AWSExecutor

_EXECUTOR_PLUGIN_DEFAULTS = {
"credentials": "",
"profile": "",
"region": "",
"credentials": "~/.aws/credentials",
"profile": "default",
"region": "us-east-1",
"s3_bucket_name": os.environ.get("BRAKET_COVALENT_S3")
or "amazon-braket-covalent-job-resources",
"ecr_image_uri": "",
Expand Down Expand Up @@ -280,9 +279,7 @@ async def query_result(self, query_metadata: Dict) -> Any:
)
events = all_log_events["events"]

log_events = ""
for event in events:
log_events += event["message"] + "\n"
log_events = "".join(event["message"] + "\n" for event in events)

# output, stdout, stderr
return result, log_events, ""
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
amazon-braket-pennylane-plugin==1.6.9
boto3==1.24.35
covalent-aws-plugins>=0.12.0,<1
amazon-braket-pennylane-plugin>=1.17.4
boto3>=1.28.5
covalent-aws-plugins>=0.19.0,<1
Loading