Skip to content

Commit

Permalink
Handle i386 as x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-fsn committed Jun 5, 2024
1 parent a4ea374 commit 7a54d80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sparecores-runner"
version = "0.0.8"
version = "0.0.9"
requires-python = ">= 3.9"
dependencies = [
"click",
Expand Down
4 changes: 3 additions & 1 deletion src/sc_runner/resources/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ def resources_aws(
instance_opts["key_name"] = pubkey.id

if "ami" not in instance_opts:
# some instances are marked as i386, but they aren't IA-32, replace them, so we can find AMIs
arch = data.server_cpu_architecture("aws", instance).lower().replace("i386", "x86_64")
ami = aws.ec2.get_ami(
most_recent=True, # in case of a filter is given as the name
filters=[
aws.ec2.GetAmiFilterArgs(name="architecture", values=[data.server_cpu_architecture("aws", instance)]),
aws.ec2.GetAmiFilterArgs(name="architecture", values=[arch]),
aws.ec2.GetAmiFilterArgs(name="name", values=[ami_name]),
aws.ec2.GetAmiFilterArgs(name="virtualization-type", values=["hvm"]),
],
Expand Down

0 comments on commit 7a54d80

Please sign in to comment.