3.2. CLI를 사용하여 AWS에 인스턴스 배포
AWS 웹 콘솔 또는 CLI에서 새 RHEL AI AMI를 사용하여 AWS 인스턴스를 시작할 수 있습니다. 인스턴스를 시작할 배포 방법을 사용할 수 있습니다. 다음 절차에서는 CLI를 사용하여 사용자 지정 AMI로 AWS 인스턴스를 시작하는 방법을 보여줍니다.
CLI를 배포 옵션으로 사용하도록 선택하는 경우 "사전 요구 사항"에 표시된 대로 생성해야 하는 여러 구성이 있습니다.
사전 요구 사항
- RHEL AI AMI를 생성하셨습니다. 자세한 내용은 "RHEL AI 이미지를 AWS AMI로 변환"을 참조하십시오.
- AWS 명령줄 툴이 설치되어 있으며 aws_access_key_id 및 aws_secret_access_key로 올바르게 구성되어 있습니다.
- VPC(Virtual Private Cloud)를 구성했습니다.
- 인스턴스의 서브넷을 생성했습니다.
- SSH 키 쌍을 생성했습니다.
- AWS에 보안 그룹을 생성했습니다.
프로세스
다양한 매개변수의 경우 변수 ID를 수집해야 합니다.
이미지 ID에 액세스하려면 다음 명령을 실행합니다.
$ aws ec2 describe-images --owners self보안 그룹 ID에 액세스하려면 다음 명령을 실행합니다.
$ aws ec2 describe-security-groups서브넷 ID에 액세스하려면 다음 명령을 실행합니다.
$ aws ec2 describe-subnets
인스턴스를 생성할 때 환경 변수 채우기
$ instance_name=rhel-ai-instance $ ami=<ami-id> $ instance_type=<instance-type-size> $ key_name=<key-pair-name> $ security_group=<sg-id> $ disk_size=<size-of-disk>다음 명령을 실행하여 변수를 사용하여 인스턴스를 생성합니다.
$ aws ec2 run-instances \ --image-id $ami \ --instance-type $instance_type \ --key-name $key_name \ --security-group-ids $security_group \ --subnet-id $subnet \ --block-device-mappings DeviceName=/dev/sda1,Ebs='{VolumeSize='$disk_size'}' \ --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value='$instance_name'}]'
사용자 계정
RHEL AI AMI의 기본 사용자 계정은 cloud-user 입니다. sudo 를 통한 암호 없이 모든 권한을 갖습니다.
검증
Red Hat Enterprise Linux AI 툴이 올바르게 설치되었는지 확인하려면
ilab명령을 실행해야 합니다.$ ilab출력 예
$ ilab Usage: ilab [OPTIONS] COMMAND [ARGS]... CLI for interacting with InstructLab. If this is your first time running ilab, it's best to start with `ilab config init` to create the environment. Options: --config PATH Path to a configuration file. [default: /home/<user>/.config/instructlab/config.yaml] -v, --verbose Enable debug logging (repeat for even more verbosity) --version Show the version and exit. --help Show this message and exit. Commands: config Command Group for Interacting with the Config of InstructLab. data Command Group for Interacting with the Data generated by... model Command Group for Interacting with the Models in InstructLab. system Command group for all system-related command calls taxonomy Command Group for Interacting with the Taxonomy of InstructLab. Aliases: chat model chat generate data generate serve model serve train model train
Updating Red Hat Enterprise Linux AI
최신 RHEL AI 버전으로 업데이트하려면 Red Hat Enterprise Linux AI 업데이트 설명서의 절차를 따르십시오.