зеркало из https://github.com/Azure/azurehpc.git
Merge pull request #248 from Azure/onboarding
example for cloud_only deployment with azurehpc
This commit is contained in:
Коммит
1a9b3e9553
|
@ -479,7 +479,7 @@ class ArmTemplate:
|
|||
}
|
||||
})
|
||||
|
||||
if ros[0] == "MicrosoftWindowsServer":
|
||||
if ros[0] == "MicrosoftWindowsServer" or ros[0] == "MicrosoftWindowsDesktop":
|
||||
self.resources.append({
|
||||
"type": "Microsoft.Network/networkSecurityGroups",
|
||||
"apiVersion": "2015-06-15",
|
||||
|
|
|
@ -187,7 +187,7 @@ def do_connect(args):
|
|||
sys.exit(1)
|
||||
|
||||
ros = rimage.split(':')
|
||||
if ros[0] == "MicrosoftWindowsServer":
|
||||
if ros[0] == "MicrosoftWindowsServer" or ros[0] == "MicrosoftWindowsDesktop":
|
||||
log.debug(f"os is - {ros[0]} for node {args.resource}")
|
||||
fqdn = azutil.get_fqdn(c.read_value("resource_group"), args.resource+"_pip")
|
||||
winpassword = c.read_value("variables.win_password")
|
||||
|
|
|
@ -192,6 +192,7 @@ def _create_anf_mount_scripts(cfg, scriptfile):
|
|||
script = """#!/bin/bash
|
||||
yum install -y nfs-utils
|
||||
"""
|
||||
script_end = ""
|
||||
resource_group = cfg["resource_group"]
|
||||
# loop over all anf accounts
|
||||
accounts = [ x for x in cfg.get("storage",{}) if cfg["storage"][x]["type"] == "anf" ]
|
||||
|
@ -204,11 +205,14 @@ yum install -y nfs-utils
|
|||
mount_point = cfg["storage"][account]["pools"][pool]["volumes"][volume]["mount"]
|
||||
script += f"""
|
||||
mkdir -p {mount_point}
|
||||
chmod 777 {mount_point}
|
||||
echo "{ip}:/{volume} {mount_point} nfs bg,rw,hard,noatime,nolock,rsize=65536,wsize=65536,vers=3,tcp,_netdev 0 0" >>/etc/fstab
|
||||
"""
|
||||
script += """
|
||||
script_end += f"""
|
||||
chmod 777 {mount_point}
|
||||
"""
|
||||
script += f"""
|
||||
mount -a
|
||||
{script_end}
|
||||
"""
|
||||
with open(scriptfile, "w") as f:
|
||||
os.chmod(scriptfile, 0o755)
|
||||
|
|
|
@ -20,4 +20,6 @@ $Computer = $env:computername
|
|||
|
||||
([ADSI]"WinNT://$Computer/$LocalGroup,group").psbase.Invoke("Add",([ADSI]"WinNT://$ad_domain/$DomainGroup").path)
|
||||
|
||||
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
|
||||
|
||||
shutdown.exe /r /t 00
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#install NFS share
|
||||
param (
|
||||
[Parameter(Mandatory=$true)][string] $ad_domain,
|
||||
[Parameter(Mandatory=$true)][string] $ad_user,
|
||||
[Parameter(Mandatory=$true)][string] $ad_password
|
||||
)
|
||||
|
||||
Write-Output $ad_domain
|
||||
Write-Output $ad_user
|
||||
Write-Output $ad_password
|
||||
|
||||
Set-NfsMappingStore -EnableADLookup $true >> D:\domain.log
|
||||
|
||||
mkdir D:\shares\nfs
|
||||
New-NfsShare -name nfs -Path d:\shares\nfs -authentication sys -EnableUnmappedAccess $False -EnableAnonymousAccess $False -permission Readwrite
|
||||
New-SmbShare -name nfs -Path d:\shares\nfs -FullAccess "Domain Users"
|
||||
|
|
@ -10,8 +10,10 @@ param (
|
|||
Write-Output $ad_domain >> D:\user.log
|
||||
Write-Output $ad_user >> D:\user.log
|
||||
|
||||
Set-ADGroup “Domain Users” -Replace @{gidNumber=”25000”}
|
||||
Write-Output "Set-ADGroup Domain Users -Replace @{gidNumber=25000}" >> D:\user.log
|
||||
Set-ADGroup “Domain Users” -Replace @{gidNumber=”25000”} >> D:\user.log
|
||||
|
||||
Write-Output "New-ADUser -Name hpcwinuser -GivenName hpcwinuser -Surname hpcwinuser -SamAccountName hpcwinuser -UserPrincipalName hpcwinuser@$ad_domain -AccountPassword(ConvertTo-SecureString $ad_password -AsPlainText -Force) -Enabled $true" >> D:\user.log
|
||||
New-ADUser `
|
||||
-Name "hpcwinuser" `
|
||||
-GivenName "hpcwinuser" `
|
||||
|
@ -20,5 +22,7 @@ New-ADUser `
|
|||
-UserPrincipalName "hpcwinuser@$ad_domain" `
|
||||
-AccountPassword(ConvertTo-SecureString $ad_password -AsPlainText -Force) `
|
||||
-Enabled $true >> D:\user.log
|
||||
Set-ADUser -identity hpcwinuser -add @{gidnumber="25000" ; uidnumber="25000" ; unixHomeDirectory=”/share/home/hpcwinuser”} >> D:\user.log
|
||||
|
||||
Write-Output "Set-ADUser -identity hpcwinuser -add @{gidnumber=25000 ; uidnumber=25000 ; unixHomeDirectory=/share/home/hpcwinuser}" >> D:\user.log
|
||||
Set-ADUser -identity hpcwinuser -add @{gidnumber="25000" ; uidnumber="25000" ; unixHomeDirectory="/share/home/hpcwinuser"} >> D:\user.log
|
||||
|
||||
|
|
|
@ -9,8 +9,21 @@ Write-Output $ad_domain
|
|||
Write-Output $ad_user
|
||||
Write-Output $ad_password
|
||||
|
||||
Install-WindowsFeature AD-Domain-Services -IncludeAllSubFeature -IncludeManagementTools
|
||||
Install-WindowsFeature DNS -IncludeAllSubFeature -IncludeManagementTools
|
||||
#AD
|
||||
Install-WindowsFeature AD-Domain-Services -IncludeAllSubFeature -IncludeManagementTools >> D:\domain.log
|
||||
#DNS
|
||||
Install-WindowsFeature DNS -IncludeAllSubFeature -IncludeManagementTools >> D:\domain.log
|
||||
#NFS
|
||||
Install-WindowsFeature FS-NFS-Service -IncludeManagementTools >> D:\domain.log
|
||||
#SSH
|
||||
#Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
|
||||
#Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
|
||||
#Install-Module -Force OpenSSHUtils -Scope AllUsers
|
||||
#Set-Service -Name ssh-agent -StartupType ‘Automatic’
|
||||
#Set-Service -Name sshd -StartupType ‘Automatic’
|
||||
#Start-Service ssh-agent
|
||||
#Start-Service sshd
|
||||
#become AD
|
||||
Install-ADDSForest `
|
||||
-CreateDnsDelegation:$false `
|
||||
-DomainName $ad_domain `
|
||||
|
@ -22,4 +35,6 @@ Install-ADDSForest `
|
|||
-LogPath C:\Windows\Logs `
|
||||
-NoRebootOnCompletion:$false `
|
||||
-Force `
|
||||
-SafeModeAdministratorPassword (ConvertTo-SecureString $ad_password -AsPlainText -Force) > D:\domain.log
|
||||
-SafeModeAdministratorPassword (ConvertTo-SecureString $ad_password -AsPlainText -Force) >> D:\domain.log
|
||||
# Set-NfsMappingStore -EnableADLookup $true >> D:\domain.log
|
||||
shutdown.exe /r /t 00
|
||||
|
|
|
@ -28,6 +28,7 @@ systemctl restart sshd
|
|||
sed -i 's@override_homedir.*@override_homedir = /share/home/%u@' /etc/sssd/sssd.conf
|
||||
sed -i 's@fallback_homedir.*@fallback_homedir = /share/home/%u@' /etc/sssd/sssd.conf
|
||||
sed -i 's@use_fully_qualified_names.*@use_fully_qualified_names = False@' /etc/sssd/sssd.conf
|
||||
sed -i 's@ldap_id_mapping.*@ldap_id_mapping = False@' /etc/sssd/sssd.conf
|
||||
systemctl restart sssd
|
||||
|
||||
cat <<EOF >/etc/ssh/ssh_config
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo $@
|
||||
|
||||
resource_group=$1
|
||||
node_name=$2
|
||||
ad_domain=$3
|
||||
|
@ -25,15 +23,6 @@ az vm run-command invoke \
|
|||
--output table
|
||||
|
||||
echo Sleeping to allow AD to reboot
|
||||
sleep 60
|
||||
|
||||
az vm run-command invoke \
|
||||
--name $node_name \
|
||||
--resource-group $resource_group \
|
||||
--command-id RunPowerShellScript \
|
||||
--scripts @$azhpc_dir/scripts/ad_user.ps1 \
|
||||
--parameters ad_domain=$ad_domain ad_user=$ad_user ad_password=$ad_password \
|
||||
--output table
|
||||
|
||||
sleep 180
|
||||
echo "AD setup done"
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
resource_group=$1
|
||||
node_name=$2
|
||||
ad_domain=$3
|
||||
ad_user=$4
|
||||
ad_password=$5
|
||||
|
||||
echo "Calling ad_nfs.ps1..."
|
||||
echo resource_group $1
|
||||
echo node_name $2
|
||||
echo ad_domain $3
|
||||
echo ad_user $4
|
||||
echo ad_password $5
|
||||
|
||||
|
||||
az vm run-command invoke \
|
||||
--name $node_name \
|
||||
--resource-group $resource_group \
|
||||
--command-id RunPowerShellScript \
|
||||
--scripts @$azhpc_dir/scripts/ad_nfs.ps1 \
|
||||
--parameters ad_domain=$ad_domain ad_user=$ad_user ad_password=$ad_password \
|
||||
--output table
|
||||
|
||||
echo "AD nfs setup done"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
resource_group=$1
|
||||
node_name=$2
|
||||
ad_domain=$3
|
||||
ad_user=$4
|
||||
ad_password=$5
|
||||
|
||||
echo "Calling ad_user.ps1..."
|
||||
echo resource_group $1
|
||||
echo node_name $2
|
||||
echo ad_domain $3
|
||||
echo ad_user $4
|
||||
echo ad_password $5
|
||||
|
||||
az vm run-command invoke \
|
||||
--name $node_name \
|
||||
--resource-group $resource_group \
|
||||
--command-id RunPowerShellScript \
|
||||
--scripts @$azhpc_dir/scripts/ad_user.ps1 \
|
||||
--parameters ad_domain=$ad_domain ad_user=$ad_user ad_password=$ad_password \
|
||||
--output table
|
||||
|
||||
echo "AD user setup done"
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
{
|
||||
"location": "variables.location",
|
||||
"resource_group": "variables.resource_group",
|
||||
"install_from": "headnode",
|
||||
"admin_user": "hpcadmin",
|
||||
"variables": {
|
||||
"image": "OpenLogic:CentOS:7.6:latest",
|
||||
"hpc_image": "OpenLogic:CentOS-HPC:7.6:latest",
|
||||
"location": "<NOT-SET>",
|
||||
"vm_type": "Standard_HB60rs",
|
||||
"resource_group": "<NOT-SET>",
|
||||
"ad_image": "MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest",
|
||||
"nv_image": "MicrosoftWindowsDesktop:Windows-10:rs5-pron:latest",
|
||||
"ad_domain": "MyDomain.local",
|
||||
"ad_admin": "hpcadmin",
|
||||
"win_password": "<NOT-SET>"
|
||||
},
|
||||
"vnet": {
|
||||
"name": "hpcvnet",
|
||||
"address_prefix": "10.2.0.0/20",
|
||||
"subnets": {
|
||||
"infra": "10.2.0.0/24",
|
||||
"netapp": "10.2.1.0/24",
|
||||
"compute": "10.2.4.0/22"
|
||||
}
|
||||
},
|
||||
"storage": {
|
||||
"hpcnetappdep": {
|
||||
"type": "anf",
|
||||
"subnet": "netapp",
|
||||
"pools": {
|
||||
"anfpool": {
|
||||
"size": 14,
|
||||
"service_level": "Premium",
|
||||
"volumes": {
|
||||
"anfvol2": {
|
||||
"size": 2,
|
||||
"mount": "/apps"
|
||||
},
|
||||
"anfvol3": {
|
||||
"size": 4,
|
||||
"mount": "/scratch"
|
||||
},
|
||||
"anfvol4": {
|
||||
"size": 4,
|
||||
"mount": "/share/home"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"adnode": {
|
||||
"type": "vm",
|
||||
"public_ip": "true",
|
||||
"password": "variables.win_password",
|
||||
"vm_type": "Standard_D4s_v3",
|
||||
"image": "variables.ad_image",
|
||||
"subnet": "infra",
|
||||
"tags": [
|
||||
"ad_server"
|
||||
]
|
||||
},
|
||||
"frontend": {
|
||||
"type": "vm",
|
||||
"public_ip": "true",
|
||||
"password": "variables.win_password",
|
||||
"vm_type": "Standard_NV6",
|
||||
"os_storage_sku": "StandardSSD_LRS",
|
||||
"image": "variables.nv_image",
|
||||
"subnet": "infra",
|
||||
"tags": [
|
||||
]
|
||||
},
|
||||
"license": {
|
||||
"type": "vm",
|
||||
"vm_type": "Standard_D4s_v3",
|
||||
"public_ip": true,
|
||||
"image": "variables.image",
|
||||
"subnet": "infra",
|
||||
"tags": [
|
||||
"cndefault",
|
||||
"netapp-client",
|
||||
"disable-selinux",
|
||||
"join_domain"
|
||||
]
|
||||
},
|
||||
"headnode": {
|
||||
"type": "vm",
|
||||
"vm_type": "Standard_D8s_v3",
|
||||
"public_ip": true,
|
||||
"image": "variables.hpc_image",
|
||||
"subnet": "compute",
|
||||
"tags": [
|
||||
"cndefault",
|
||||
"netapp-client",
|
||||
"pbsserver",
|
||||
"loginnode",
|
||||
"localuser",
|
||||
"disable-selinux",
|
||||
"join_domain"
|
||||
]
|
||||
},
|
||||
"compute": {
|
||||
"type": "vmss",
|
||||
"vm_type": "variables.vm_type",
|
||||
"instances": 2,
|
||||
"image": "variables.hpc_image",
|
||||
"subnet": "compute",
|
||||
"tags": [
|
||||
"netapp-client",
|
||||
"pbsclient",
|
||||
"cndefault",
|
||||
"localuser",
|
||||
"disable-selinux",
|
||||
"join_domain"
|
||||
]
|
||||
}
|
||||
},
|
||||
"install": [
|
||||
{
|
||||
"script": "setup_win_ad.sh",
|
||||
"type": "local_script",
|
||||
"args": [
|
||||
"variables.resource_group",
|
||||
"$(<hostlists/tags/ad_server)",
|
||||
"variables.ad_domain",
|
||||
"variables.ad_admin",
|
||||
"variables.win_password"
|
||||
]
|
||||
},
|
||||
{
|
||||
"script": "setup_win_ad_nfs.sh",
|
||||
"type": "local_script",
|
||||
"args": [
|
||||
"variables.resource_group",
|
||||
"$(<hostlists/tags/ad_server)",
|
||||
"variables.ad_domain",
|
||||
"variables.ad_admin",
|
||||
"variables.win_password"
|
||||
]
|
||||
},
|
||||
{
|
||||
"script": "disable-selinux.sh",
|
||||
"tag": "disable-selinux",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "cndefault.sh",
|
||||
"tag": "cndefault",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "auto_netappfiles_mount.sh",
|
||||
"tag": "netapp-client",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "localuser.sh",
|
||||
"args": [
|
||||
"$(<hostlists/tags/nfsserver)"
|
||||
],
|
||||
"tag": "localuser",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "pbsdownload.sh",
|
||||
"tag": "loginnode",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "pbsserver.sh",
|
||||
"copy": [
|
||||
"pbspro_19.1.1.centos7/pbspro-server-19.1.1-0.x86_64.rpm"
|
||||
],
|
||||
"tag": "pbsserver",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "pbsclient.sh",
|
||||
"args": [
|
||||
"$(<hostlists/tags/pbsserver)"
|
||||
],
|
||||
"copy": [
|
||||
"pbspro_19.1.1.centos7/pbspro-execution-19.1.1-0.x86_64.rpm"
|
||||
],
|
||||
"tag": "pbsclient",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "join_domain.sh",
|
||||
"args": [
|
||||
"variables.ad_domain",
|
||||
"variables.ad_admin",
|
||||
"variables.win_password",
|
||||
"$(<hostlists/tags/ad_server)"
|
||||
],
|
||||
"tag": "join_domain",
|
||||
"sudo": true
|
||||
},
|
||||
{
|
||||
"script": "setup_win_join_domain.sh",
|
||||
"type": "local_script",
|
||||
"args": [
|
||||
"variables.resource_group",
|
||||
"frontend",
|
||||
"variables.ad_domain",
|
||||
"$(<hostlists/tags/ad_server)",
|
||||
"variables.ad_admin",
|
||||
"variables.win_password"
|
||||
]
|
||||
},
|
||||
{
|
||||
"script": "setup_win_ad_user.sh",
|
||||
"type": "local_script",
|
||||
"args": [
|
||||
"variables.resource_group",
|
||||
"$(<hostlists/tags/ad_server)",
|
||||
"variables.ad_domain",
|
||||
"variables.ad_admin",
|
||||
"variables.win_password"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
example for onboarding
|
||||
|
||||
to use:
|
||||
```
|
||||
#> git clone https://github.com/Azure/azurehpc
|
||||
#> source azurehpc/install.sh
|
||||
#> azhpc-init -c $azhpc_dir/tutorials/onboarding -d onboarding -v resource_group=azurehpc-cluster,location=westeurope,win_password=[yourpasswordhere]
|
||||
#> cd onboarding
|
||||
#> azhpc-build
|
||||
```
|
||||
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче