Skip to content
Open
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
18 changes: 9 additions & 9 deletions dask_cloudprovider/aws/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def get_security_group(client, vpc, create_default=True):
if create_default:
try:
return await create_default_security_group(
client, DEFAULT_SECURITY_GROUP_NAME, vpc
client, DEFAULT_SECURITY_GROUP_NAME, vpc, tags=None
)
except Exception as e:
raise RuntimeError(
Expand All @@ -95,20 +95,20 @@ async def get_security_group(client, vpc, create_default=True):


async def create_default_security_group(client, group_name, vpc, tags):
tag_list = [{"Key": k, "Value": v} for k, v in (tags or {}).items() if k and v]
response = await client.create_security_group(
Description="A default security group for Dask",
GroupName=group_name,
VpcId=vpc,
TagSpecifications=[
**(
{
"ResourceType": "security-group",
"Tags": [
{"Key": k, "Value": v}
for k, v in (tags or {}).items()
if k and v # Filter out empty tags
],
"TagSpecifications": [
{"ResourceType": "security-group", "Tags": tag_list}
]
}
],
if tag_list
else {}
),
DryRun=False,
)

Expand Down
10 changes: 5 additions & 5 deletions dask_cloudprovider/aws/tests/test_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,20 @@ async def skip_without_credentials():


@pytest.fixture
@pytest.mark.external
async def cluster():
await skip_without_credentials()
async with EC2Cluster(asynchronous=True) as cluster:
yield cluster


@pytest.fixture
@pytest.mark.external
async def cluster_sync():
await skip_without_credentials()
cluster = EC2Cluster()
yield cluster


@pytest.fixture
@pytest.mark.external
async def cluster_rapids():
await skip_without_credentials()
async with EC2Cluster(
Expand All @@ -57,7 +54,6 @@ async def cluster_rapids():


@pytest.fixture
@pytest.mark.external
async def cluster_rapids_packer():
await skip_without_credentials()
async with EC2Cluster(
Expand All @@ -74,7 +70,6 @@ async def cluster_rapids_packer():


@pytest.fixture
@pytest.mark.external
async def cluster_packer():
await skip_without_credentials()
async with EC2Cluster(
Expand All @@ -99,6 +94,7 @@ async def test_init():

@pytest.mark.asyncio
@pytest.mark.timeout(600)
@pytest.mark.external
async def test_create_cluster(cluster):
assert cluster.status == Status.running

Expand All @@ -113,6 +109,7 @@ async def test_create_cluster(cluster):

@pytest.mark.asyncio
@pytest.mark.timeout(600)
@pytest.mark.external
async def test_create_cluster_sync(cluster_sync):
assert cluster_sync.status == Status.running

Expand All @@ -125,6 +122,7 @@ async def test_create_cluster_sync(cluster_sync):

@pytest.mark.asyncio
@pytest.mark.timeout(600)
@pytest.mark.external
async def test_create_cluster_with_packer(cluster_packer):
assert cluster_packer.status == Status.running

Expand All @@ -139,6 +137,7 @@ async def test_create_cluster_with_packer(cluster_packer):

@pytest.mark.asyncio
@pytest.mark.timeout(1200)
@pytest.mark.external
async def test_create_rapids_cluster(cluster_rapids):
assert cluster_rapids.status == Status.running

Expand All @@ -158,6 +157,7 @@ def f():

@pytest.mark.asyncio
@pytest.mark.timeout(1200)
@pytest.mark.external
async def test_create_rapids_cluster_with_packer(cluster_rapids_packer):
assert cluster_rapids_packer.status == Status.running

Expand Down
1 change: 0 additions & 1 deletion dask_cloudprovider/digitalocean/tests/test_droplet.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ async def config():


@pytest.fixture
@pytest.mark.external
async def cluster(config):
await skip_without_credentials(config)
async with DropletCluster(asynchronous=True) as cluster:
Expand Down
2 changes: 1 addition & 1 deletion dask_cloudprovider/hetzner/tests/test_vserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ async def config():


@pytest.fixture
@pytest.mark.external
async def cluster(config):
await skip_without_credentials(config)
async with HetznerCluster(asynchronous=True) as cluster:
Expand All @@ -51,6 +50,7 @@ async def test_init():

@pytest.mark.asyncio
@pytest.mark.timeout(600)
@pytest.mark.external
async def test_create_cluster(cluster):
assert cluster.status == Status.running

Expand Down
1 change: 0 additions & 1 deletion dask_cloudprovider/nebius/tests/test_nebius.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ async def config():


@pytest.fixture
@pytest.mark.external
async def cluster(config):
await skip_without_credentials(config)
async with NebiusCluster(asynchronous=True, debug=True) as cluster:
Expand Down
2 changes: 1 addition & 1 deletion dask_cloudprovider/openstack/tests/test_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ async def config():


@pytest.fixture
@pytest.mark.external
async def cluster(config):
await skip_without_credentials(config)

Expand All @@ -50,6 +49,7 @@ async def test_init():

@pytest.mark.asyncio
@pytest.mark.timeout(600)
@pytest.mark.external
async def test_create_cluster(cluster):
assert cluster.status == Status.running
cluster.scale(1)
Expand Down
Loading