Skip to content

Commit

Permalink
restore using subprocess instead of docker
Browse files Browse the repository at this point in the history
- Github Actions doesn't allow use of http+docker URL scheme
  • Loading branch information
pymonger committed May 21, 2024
1 parent eafec43 commit 4be97c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies = [
"moto[all]~=5.0.6",
"httpx~=0.27.0",
"respx~=0.21.1",
"docker~=7.0.0",
# TODO: remove cryptography pin when this issue resolved:
# cryptography/hazmat/bindings/_rust.abi3.so: cannot open shared object file: No such file or directory
"cryptography<35.0.0",
Expand Down
24 changes: 12 additions & 12 deletions tests/test_lambda.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import os
import subprocess
from importlib.metadata import version
from uuid import uuid4

import boto3
import docker
import pytest
import respx
from botocore.exceptions import ClientError
Expand Down Expand Up @@ -85,18 +85,18 @@ def build_mock_lambda_package():
"Running build_lambda_script: %s\nThis may take some time...",
build_lambda_script,
)
client = docker.from_env()
client.containers.run(
"mlupin/docker-lambda:python3.9-build",
"./scripts/build_mock_lambda_package.sh",
auto_remove=True,
volumes={
f"{os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))}": {
"bind": "/var/task",
"mode": "rw",
}
},
proc = subprocess.run(
[
"docker",
"run",
"--rm",
"-v",
f"{os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))}:/var/task",
"mlupin/docker-lambda:python3.9-build",
"./scripts/build_mock_lambda_package.sh",
]
)
assert proc.returncode == 0


def get_lambda_code():
Expand Down

0 comments on commit 4be97c7

Please sign in to comment.