diff options
| author | nicole mazzuca <mazzucan@outlook.com> | 2020-09-24 15:15:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-24 15:15:06 -0700 |
| commit | 4cbbcbddfd42d94d6d8ee6c8b6ad00ef6a0927d3 (patch) | |
| tree | 371509cc59c45895c85e5e049aaa2cd9c39cc7b0 /scripts/azure-pipelines/osx/configuration | |
| parent | c1acea1f044d3300b0c3791c2ce74d53e5a15548 (diff) | |
| download | vcpkg-4cbbcbddfd42d94d6d8ee6c8b6ad00ef6a0927d3.tar.gz vcpkg-4cbbcbddfd42d94d6d8ee6c8b6ad00ef6a0927d3.zip | |
[vcpkg macos ci] Switch to using our own base boxes, to fix bringing up mac machines (#13619)
* [vcpkg ci:osx] Remove brew install
* add instructions for creating a new vagrant box
* fix the vagrant scripts for the new box
* finish fixing the setup
* [mecab jxrlib] fix ports for CI
mecab needed to use an actual ref that wasn't master,
and jxrlib needed a patch for xcode 12 CLTs.
Additionally, this fixes the mecab version to be a date, the date of the last commit,
since `1.0` is not the correct version (mecab doesn't have released versions)
* [many ports] fix compile with Xcode 12 CLTs
This mostly means fixing errors on implicit-function-declaration,
and removing some Werrors
* alac-decoder
* apr
* argtable2
* arrow
* hyperscan
* mcpp
* minizip
* mosquitto
* stormlib
* [many ports] even more Xcode 12 CLT fixes
* [jxrlib darknet] fix the last ports! (hopefully)
* CRs, plus minor wip changes to osx scripts
Diffstat (limited to 'scripts/azure-pipelines/osx/configuration')
3 files changed, 142 insertions, 145 deletions
diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile deleted file mode 100644 index 1e1cce50f..000000000 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ /dev/null @@ -1,136 +0,0 @@ -require 'json' - -require "erb" -include ERB::Util - -configuration = JSON.parse(File.read('./vagrant-configuration.json')) - -servers = configuration['machine_identifiers'].map do |id| - { - :hostname => "#{configuration['base_name']}-#{id}", - :box => 'ramsey/macos-catalina', - :ram => 12000, - :cpu => 5 - } -end - -brew_formulas = [ - 'autoconf', - 'automake', - 'libtool', - 'bison' ] - -brew_cask_formulas = [ - 'powershell', - 'gfortran' ] - -azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/2.171.1/vsts-agent-osx-x64-2.171.1.tar.gz' -devops_url = 'https://dev.azure.com/vcpkg' -agent_pool = 'vcpkgAgentPool' -pat = configuration['pat'] -archives = configuration['archives'] -archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}" - -Vagrant.configure('2') do |config| - # give them extra time to boot up - config.vm.boot_timeout = 600 - - servers.each do |machine| - config.vm.define machine[:hostname] do |node| - - node.vm.box = machine[:box] - node.vm.hostname = machine[:hostname] - node.vm.synced_folder '.', '/vagrant', disabled: true - - diskname = "#{machine[:hostname]}-data.vmdk" - - # I don't like this, but as far as I can tell, it's the only way - # to do this. When vagrant finishes the `disk` feature, switch - # over to that -- Nicole Mazzuca - if (not File.exists? diskname) then - system "VBoxManage createmedium --filename #{diskname} --size #{1024 * 220}" - end - - node.vm.provider 'virtualbox' do |vb| - vb.memory = machine[:ram] - vb.cpus = machine[:cpu] - vb.customize ['modifyvm', :id, '--ioapic', 'on'] - vb.customize ['storageattach', :id, - '--storagectl', 'SATA Controller', - '--port', '1', '--device', '0', '--type', 'hdd', - '--medium', "#{diskname}" - ] - end - - node.vm.provision 'shell', - run: 'once', - name: 'Format and mount the data filesystem', - inline: 'diskutil partitionDisk /dev/disk0 1 GPT jhfs+ data 0', - privileged: true - - node.vm.provision 'shell', - run: 'once', - name: 'Link the data filesystem to the home directory', - inline: "ln -s /Volumes/data ~/Data", - privileged: false - - node.vm.provision 'shell', - run: 'once', - name: 'Download azure agent', - inline: "curl -s -o ~/Downloads/azure-agent.tar.gz #{azure_agent_url}", - privileged: false - - node.vm.provision 'shell', - run: 'once', - name: 'Unpack azure agent', - inline: 'mkdir myagent; cd myagent; tar xf ~/Downloads/azure-agent.tar.gz', - privileged: false - - node.vm.provision 'shell', - run: 'once', - name: 'Install brew and xcode command line tools', - inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', - privileged: false - - node.vm.provision 'shell', - run: 'once', - name: 'Install brew applications', - inline: "brew install #{brew_formulas.join(' ')} && brew cask install #{brew_cask_formulas.join(' ')}", - privileged: false - - node.vm.provision 'shell', - run: 'once', - name: 'Create archives mountpoint', - inline: 'mkdir ~/Data/archives', - privileged: false - - node.vm.provision "shell", - run: 'once', - name: 'Mount archives directory', - inline: "mount_smbfs -d 777 -f 777 #{archives_url} ~/Data/archives", - privileged: false - - node.vm.provision 'shell', - run: 'once', - name: 'Add VM to azure agent pool', - inline: "cd ~/myagent;\ - ./config.sh --unattended \ - --url #{devops_url} \ - --work ~/Data/work \ - --auth pat --token #{pat} \ - --pool #{agent_pool} \ - --agent `hostname` \ - --replace \ - --acceptTeeEula", - privileged: false - - # Start listening for jobs - node.vm.provision 'shell', - run: 'always', - name: 'Start running azure pipelines', - inline: 'cd /Users/vagrant/myagent;\ - nohup ./run.sh&', - privileged: false - end - end -end diff --git a/scripts/azure-pipelines/osx/configuration/Vagrantfile b/scripts/azure-pipelines/osx/configuration/Vagrantfile new file mode 100644 index 000000000..91a59860c --- /dev/null +++ b/scripts/azure-pipelines/osx/configuration/Vagrantfile @@ -0,0 +1,129 @@ +require 'json' + +require "erb" +include ERB::Util + +configuration = JSON.parse(File.read('./vagrant-configuration.json')) + +server = { + :hostname => configuration['machine_name'], + :box => configuration['box_name'], + :box_version => configuration['box_version'], + :disk_size => configuration['disk_size'], + :ram => 12000, + :cpu => 5 +} + +brew_formulas = [ + 'autoconf', + 'automake', + 'bison', + 'libtool', + 'mono', + 'pkg-config', + 'yasm' ] + +brew_cask_formulas = [ + 'powershell', + 'gfortran' ] + +azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/2.171.1/vsts-agent-osx-x64-2.171.1.tar.gz' +devops_url = configuration['devops_url'] +agent_pool = configuration['agent_pool'] +pat = configuration['pat'] +archives = configuration['archives'] +archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}" + +Vagrant.configure('2') do |config| + # give them extra time to boot up + config.vm.boot_timeout = 600 + + config.vm.box = server[:box] + config.vm.box_version = server[:box_version] + config.vm.hostname = server[:hostname] + config.vm.synced_folder '.', '/vagrant', disabled: true + + diskname = "#{server[:hostname]}-data.vmdk" + + # I don't like this, but as far as I can tell, it's the only way + # to do this. When vagrant finishes the `disk` feature, switch + # over to that -- Nicole Mazzuca + if (not File.exists? diskname) then + system "VBoxManage createmedium --filename #{diskname} --size #{1024 * server[:disk_size]}" + end + + config.vm.provider 'virtualbox' do |vb| + vb.memory = server[:ram] + vb.cpus = server[:cpu] + vb.customize ['modifyvm', :id, '--ioapic', 'on'] + vb.customize ['storageattach', :id, + '--storagectl', 'SATA Controller', + '--port', '1', '--device', '0', '--type', 'hdd', + '--medium', "#{diskname}" + ] + end + + config.vm.provision 'shell', + run: 'once', + name: 'Format and mount the data filesystem', + inline: 'diskutil partitionDisk /dev/disk0 1 GPT jhfs+ data 0', + privileged: true + + config.vm.provision 'shell', + run: 'once', + name: 'Link the data filesystem to the home directory', + inline: "ln -s /Volumes/data ~/Data", + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Download azure agent', + inline: "curl -s -o ~/Downloads/azure-agent.tar.gz #{azure_agent_url}", + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Unpack azure agent', + inline: 'mkdir myagent; cd myagent; tar xf ~/Downloads/azure-agent.tar.gz', + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Install brew applications', + inline: "brew install #{brew_formulas.join(' ')} && brew cask install #{brew_cask_formulas.join(' ')}", + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Create archives mountpoint', + inline: 'mkdir ~/Data/archives', + privileged: false + + config.vm.provision "shell", + run: 'once', + name: 'Mount archives directory', + inline: "mount_smbfs -d 777 -f 777 #{archives_url} ~/Data/archives", + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Add VM to azure agent pool', + inline: "cd ~/myagent;\ + ./config.sh --unattended \ + --url #{devops_url} \ + --work ~/Data/work \ + --auth pat --token #{pat} \ + --pool #{agent_pool} \ + --agent `hostname` \ + --replace \ + --acceptTeeEula", + privileged: false + + # Start listening for jobs + config.vm.provision 'shell', + run: 'always', + name: 'Start running azure pipelines', + inline: 'cd /Users/vagrant/myagent;\ + nohup ./run.sh&', + privileged: false +end diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json index f0abc1673..d806f4861 100644 --- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json +++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -15,20 +15,24 @@ "pat": { "type": "string" }, - "base_name": { + "agent_pool": { + "type": "string" + }, + "devops_url": { + "type": "string" + }, + "machine_name": { + "type": "string" + }, + "box_name": { + "type": "string" + }, + "box_version": { "type": "string" }, "disk_size": { "type": "integer" }, - "machine_identifiers": { - "type": "array", - - "items": { - "type": "string", - "pattern": "[0-9]{2}" - } - }, "archives": { "type": "object", "required": [ |
