Skip to content

Commit

Permalink
[create-vm-flavor-adxt-814] Implemented python side
Browse files Browse the repository at this point in the history
  • Loading branch information
CelianR committed Jan 13, 2025
1 parent f1e2a24 commit aff26d9
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 5 deletions.
6 changes: 1 addition & 5 deletions common/config/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,7 @@ func (e *CommonEnvironment) AgentVersion() string {
}

func (e *CommonEnvironment) AgentFlavor() string {
flavor := e.AgentConfig.Get(DDAgentFlavorParamName)

panic("flavor: " + flavor)

return flavor
return e.AgentConfig.Get(DDAgentFlavorParamName)
}

func (e *CommonEnvironment) PipelineID() string {
Expand Down
2 changes: 2 additions & 0 deletions tasks/aks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def create_aks(
install_agent: Optional[bool] = True,
install_workload: Optional[bool] = True,
agent_version: Optional[str] = None,
agent_flavor: Optional[str] = None,
):
print('This command is deprecated, please use `az.create-aks` instead')
print("Running `az.create-aks`...")
Expand All @@ -33,6 +34,7 @@ def create_aks(
install_agent=install_agent,
install_workload=install_workload,
agent_version=agent_version,
agent_flavor=agent_flavor,
)


Expand Down
2 changes: 2 additions & 0 deletions tasks/aws/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def deploy(
deploy_job: Optional[str] = None,
full_image_path: Optional[str] = None,
cluster_agent_full_image_path: Optional[str] = None,
agent_flavor: Optional[str] = None,
) -> str:
flags = extra_flags if extra_flags else {}

Expand Down Expand Up @@ -87,6 +88,7 @@ def deploy(
use_fakeintake,
full_image_path,
cluster_agent_full_image_path,
agent_flavor,
)


Expand Down
2 changes: 2 additions & 0 deletions tasks/aws/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def create_docker(
use_loadBalancer: Optional[bool] = False,
interactive: Optional[bool] = True,
full_image_path: Optional[str] = None,
agent_flavor: Optional[str] = None,
):
"""
Create a docker environment.
Expand All @@ -59,6 +60,7 @@ def create_docker(
use_fakeintake=use_fakeintake,
extra_flags=extra_flags,
full_image_path=full_image_path,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/aws/eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def create_eks(
instance_type: Optional[str] = None,
full_image_path: Optional[str] = None,
cluster_agent_full_image_path: Optional[str] = None,
agent_flavor: Optional[str] = None,
):
"""
Create a new EKS environment. It lasts around 20 minutes.
Expand Down Expand Up @@ -81,6 +82,7 @@ def create_eks(
extra_flags=extra_flags,
full_image_path=full_image_path,
cluster_agent_full_image_path=cluster_agent_full_image_path,
agent_flavor=agent_flavor,
)

tool.notify(ctx, "Your EKS cluster is now created")
Expand Down
2 changes: 2 additions & 0 deletions tasks/aws/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def create_installer_lab(
debug: Optional[bool] = False,
pipeline_id: Optional[str] = None,
site: Optional[str] = "datad0g.com",
agent_flavor: Optional[str] = None,
):
full_stack_name = deploy(
ctx,
Expand All @@ -31,6 +32,7 @@ def create_installer_lab(
install_installer=True,
debug=debug,
extra_flags={"ddagent:site": site},
agent_flavor=agent_flavor,
)

print(f"Installer lab created: {full_stack_name}")
Expand Down
2 changes: 2 additions & 0 deletions tasks/aws/kind.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def create_kind(
interactive: Optional[bool] = True,
full_image_path: Optional[str] = None,
cluster_agent_full_image_path: Optional[str] = None,
agent_flavor: Optional[str] = None,
):
"""
Create a kind environment.
Expand All @@ -68,6 +69,7 @@ def create_kind(
app_key_required=True,
full_image_path=full_image_path,
cluster_agent_full_image_path=cluster_agent_full_image_path,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/aws/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def create_vm(
no_verify: Optional[bool] = False,
ssh_user: Optional[str] = None,
add_known_host: Optional[bool] = True,
agent_flavor: Optional[str] = None,
) -> None:
"""
Create a new virtual machine on aws.
Expand Down Expand Up @@ -110,6 +111,7 @@ def create_vm(
extra_flags=extra_flags,
use_fakeintake=use_fakeintake,
deploy_job=deploy_job,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/azure/aks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def create_aks(
full_image_path: Optional[str] = None,
cluster_agent_full_image_path: Optional[str] = None,
use_fakeintake: Optional[bool] = False,
agent_flavor: Optional[str] = None,
):
"""
Create a new AKS environment. It lasts around 5 minutes.
Expand Down Expand Up @@ -66,6 +67,7 @@ def create_aks(
full_image_path=full_image_path,
cluster_agent_full_image_path=cluster_agent_full_image_path,
use_fakeintake=use_fakeintake,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/azure/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def create_vm(
no_verify: Optional[bool] = False,
use_fakeintake: Optional[bool] = False,
add_known_host: Optional[bool] = True,
agent_flavor: Optional[str] = None,
) -> None:
"""
Create a new virtual machine on azure.
Expand Down Expand Up @@ -103,6 +104,7 @@ def create_vm(
debug=debug,
extra_flags=extra_flags,
use_fakeintake=use_fakeintake,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def deploy(
use_fakeintake: Optional[bool] = False,
full_image_path: Optional[str] = None,
cluster_agent_full_image_path: Optional[str] = None,
agent_flavor: Optional[str] = None,
) -> str:
flags = extra_flags if extra_flags else {}

Expand All @@ -47,6 +48,7 @@ def deploy(
flags["scenario"] = scenario_name
flags["ddagent:pipeline_id"] = pipeline_id
flags["ddagent:version"] = agent_version
flags["ddagent:flavor"] = agent_flavor
flags["ddagent:fakeintake"] = use_fakeintake
flags["ddagent:fullImagePath"] = full_image_path
flags["ddagent:clusterAgentFullImagePath"] = cluster_agent_full_image_path
Expand Down
2 changes: 2 additions & 0 deletions tasks/gcp/gke.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def create_gke(
cluster_agent_full_image_path: Optional[str] = None,
use_fakeintake: Optional[bool] = False,
use_autopilot: Optional[bool] = False,
agent_flavor: Optional[str] = None,
) -> None:
"""
Create a new GKE environment.
Expand Down Expand Up @@ -67,6 +68,7 @@ def create_gke(
full_image_path=full_image_path,
cluster_agent_full_image_path=cluster_agent_full_image_path,
use_fakeintake=use_fakeintake,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/gcp/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def create_vm(
no_verify: Optional[bool] = False,
use_fakeintake: Optional[bool] = False,
add_known_host: Optional[bool] = True,
agent_flavor: Optional[str] = None,
) -> None:
"""
Create a new virtual machine on gcp.
Expand Down Expand Up @@ -110,6 +111,7 @@ def create_vm(
debug=debug,
extra_flags=extra_flags,
use_fakeintake=use_fakeintake,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down
2 changes: 2 additions & 0 deletions tasks/localpodman/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def create_vm(
use_fakeintake: Optional[bool] = False,
interactive: Optional[bool] = True,
add_known_host: Optional[bool] = True,
agent_flavor: Optional[str] = None,
) -> None:
"""
Create a new virtual machine on local podman.
Expand Down Expand Up @@ -68,6 +69,7 @@ def create_vm(
debug=debug,
extra_flags=extra_flags,
use_fakeintake=use_fakeintake,
agent_flavor=agent_flavor,
)

if interactive:
Expand Down

0 comments on commit aff26d9

Please sign in to comment.