diff --git a/tests/publiccloud/aistack_basic.pm b/tests/publiccloud/aistack_basic.pm new file mode 100644 index 000000000000..2650ca527237 --- /dev/null +++ b/tests/publiccloud/aistack_basic.pm @@ -0,0 +1,71 @@ +use Mojo::Base 'publiccloud::basetest'; +use testapi; +use serial_terminal 'select_serial_terminal'; +use strict; +use warnings; +use utils; +use publiccloud::utils; +use File::Basename; + +sub run { + + #Create aws instance + select_serial_terminal(); + my $provider = $args->{my_provider}; + my $instance = $provider->create_instance(); + registercloudguest($instance) if is_byos(); + register_addons_in_pc($instance); + + #Update and install dependencies + $instance->ssh_assert_script_run('sudo zypper ref; sudo zypper -n up', + timeout => 1000); + record_info('Refresh and update'); + sleep 90; # wait for a bit for zypper to be available + + #Install Docker (required for RKE2) + + $instance->ssh_assert_script_run('sudo zypper install -y curl', + timeout => 100); + $instance->ssh_assert_script_run('sudo zypper install -y docker', + timeout => 100); + $instance->ssh_assert_script_run('sudo systemctl start docker', + timeout => 100); + $instance->ssh_assert_script_run('sudo systemctl enable docker', + timeout => 100); + $instance->ssh_assert_script_run('sudo systemctl status docker', + timeout => 100); + record_info('Installed Docker'); + + #Install RKE2 + $instance->ssh_assert_script_run('curl -sfL https://get.rke2.io | sh', + timeout => 1000); + $instance->ssh_assert_script_run('sudo systemctl enable rke2-server', + timeout => 100); + $instance->ssh_assert_script_run('sudo systemctl start rke2-server', + timeout => 100); + $instance->ssh_assert_script_run('sudo systemctl status rke2-server', + timeout => 100); + record_info('Installed RKE2'); + + #Install kubectl + $instance->ssh_assert_script_run( + 'curl -LO "https://dl.k8s.io/release/v1.26.0/bin/linux/amd64/kubectl', + timeout => 1000); + $instance->ssh_assert_script_run('chmod +x ./kubectl', timeout => 100); + $instance->ssh_assert_script_run( + 'sudo mv ./kubectl /usr/local/bin/kubectl', + timeout => 100); + $instance->ssh_assert_script_run('kubectl version --client', + timeout => 100); + record_info('RKE2 setup is complete'); + + #Install Helm and private-ai-charts repo + + $instance->ssh_assert_script_run( + 'curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash', + timeout => 1000 + ); + record_info('helm private-ai-chart install complete'); +} + +1;