Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
96d8729
Test with MacOS-14
IDzyre May 13, 2024
603d9c9
Test with MacOS-14
IDzyre May 13, 2024
ac8566f
Test with MacOS-14
IDzyre May 13, 2024
b081d11
try libvirt
IDzyre May 13, 2024
b3dcbfb
try libvirt
IDzyre May 13, 2024
df943fb
try qemu again
IDzyre May 13, 2024
808be46
try qemu again
IDzyre May 13, 2024
bf09a4e
try libvirt again
IDzyre May 13, 2024
f9217d4
try libvirt again
IDzyre May 13, 2024
c562845
try libvirt again
IDzyre May 13, 2024
7cf67cc
try libvirt again
IDzyre May 13, 2024
199ef43
try libvirt again
IDzyre May 13, 2024
a469b42
try libvirt again
IDzyre May 13, 2024
9a640fe
try libvirt again
IDzyre May 13, 2024
e504e27
try libvirt again
IDzyre May 13, 2024
2a09758
try libvirt again
IDzyre May 13, 2024
96074f8
try qemu again
IDzyre May 13, 2024
52f4fb9
try qemu again
IDzyre May 13, 2024
d98c7f9
try qemu again
IDzyre May 13, 2024
ea99b02
try qemu again
IDzyre May 13, 2024
fa776a7
try qemu again
IDzyre May 13, 2024
120c185
try qemu again
IDzyre May 13, 2024
31d4045
try qemu again
IDzyre May 13, 2024
7660a10
try qemu again
IDzyre May 13, 2024
efdea42
try qemu again
IDzyre May 13, 2024
5c04dfb
try qemu again
IDzyre May 13, 2024
71b5d3a
try libvirt again
IDzyre May 13, 2024
d7ced7e
try libvirt again
IDzyre May 13, 2024
34a77a8
try libvirt again
IDzyre May 13, 2024
83afdcf
try libvirt again
IDzyre May 13, 2024
2a55f35
try libvirt again
IDzyre May 13, 2024
c2a6f37
Test with no sudo
IDzyre May 14, 2024
389b6a9
Test with no sudo
IDzyre May 14, 2024
87c2b9b
Test with no sudo
IDzyre May 14, 2024
a9de686
Test with no sudo
IDzyre May 14, 2024
d3120c0
Test with no sudo
IDzyre May 14, 2024
150dfae
Test sm password
IDzyre May 14, 2024
eb6808d
Test sm password
IDzyre May 14, 2024
8527edd
testing sudo
IDzyre May 14, 2024
1f46db5
testing sudo and smb
IDzyre May 14, 2024
6c6046d
testing sudo and smb
IDzyre May 14, 2024
655392e
testing sudo and smb
IDzyre May 14, 2024
b002fd6
cant use macos
IDzyre May 14, 2024
58b844a
cant use macos
IDzyre May 14, 2024
89d5cde
use libvirt?
IDzyre May 14, 2024
0aabbef
use libvirt?
IDzyre May 14, 2024
cb74253
use libvirt?
IDzyre May 14, 2024
51a7c1c
use libvirt?
IDzyre May 14, 2024
fe3c83f
use libvirt?
IDzyre May 14, 2024
e8539b6
merge
IDzyre May 15, 2024
1d3751f
try 1
IDzyre May 15, 2024
66c19e4
use libv
IDzyre May 15, 2024
2e3146d
use libv
IDzyre May 15, 2024
3ce2f07
macos-latest?
IDzyre May 15, 2024
fb55b27
macos-13?
IDzyre May 15, 2024
1082c35
macos-13?
IDzyre May 15, 2024
b5d9491
qemu not qemmu
IDzyre May 15, 2024
04466af
force
IDzyre May 15, 2024
6d655ca
change qemu dir
IDzyre May 15, 2024
fb8c458
smb
IDzyre May 15, 2024
8d14ecd
smb
IDzyre May 15, 2024
de3f1a5
aaaa
IDzyre May 15, 2024
70a30db
aaaa
IDzyre May 15, 2024
5c4d19d
aaaa
IDzyre May 15, 2024
bc67ad7
aaaa
IDzyre May 15, 2024
3c42f47
aaaa
IDzyre May 15, 2024
781627f
aaaa
IDzyre May 15, 2024
5420749
aaaa
IDzyre May 15, 2024
a598c8f
aaaa
IDzyre May 15, 2024
8d69289
aaaa
IDzyre May 15, 2024
59e9ed9
aaaa
IDzyre May 15, 2024
72db3cd
aaaa
IDzyre May 15, 2024
ec26c3e
aaaa
IDzyre May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 42 additions & 24 deletions .github/workflows/save_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:

pull_request:
permissions:
contents: read

jobs:
vagrant-up:
vagrant-up-virtualbox:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
Expand All @@ -30,27 +30,45 @@ jobs:
run: CI=1 vagrant up
- name: Validate image
run: curl --show-error --fail --include http://localhost:1511
- name: Save image
run: vagrant package --output submitty.box
- name: Publish image
# - name: Save image
# run: vagrant package --output submitty.box
# - name: Publish image
# run: |
# vagrant cloud auth login --token ${{ secrets.VAGRANT_CLOUD_TOKEN }}
# vagrant cloud publish SubmittyBot/ubuntu22-dev ${{ steps.get-version.outputs.version }}.$(date +"%y%m%d%H%M") virtualbox submitty.box --release --force
# vagrant cloud auth logout
# - name: Acquire Job ID
# if: failure()
# id: get-job-id
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# jobs=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs)
# job_id=$(echo $jobs | jq -r '.jobs[] | select(.runner_name=="${{ runner.name }}") | .id')
# echo "job_id=$job_id" >> $GITHUB_OUTPUT
# - name: Send zulip message on failure
# if: failure()
# run: >-
# curl -X POST https://submitty.zulipchat.com/api/v1/messages -u ${{ secrets.ZULIP_AUTHENTICATION }}
# --data-urlencode 'type=stream'
# --data-urlencode 'to=Submitty Developer Studio'
# --data-urlencode 'topic=Vagrant Up Failures'
# --data-urlencode 'content=The Package Vagrant VM Github Action has failed for Virtual-Box, this means the VM is not saved, and requires attention. View here: https://github.com/Submitty/Submitty/actions/runs/${{ github.run_id }}/job/${{ steps.get-job-id.outputs.job_id }}'

vagrant-up-qemu:
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install QEMU and Vagrant
run: |
vagrant cloud auth login --token ${{ secrets.VAGRANT_CLOUD_TOKEN }}
vagrant cloud publish SubmittyBot/ubuntu22-dev ${{ steps.get-version.outputs.version }}.$(date +"%y%m%d%H%M") virtualbox submitty.box --release --force
vagrant cloud auth logout
- name: Acquire Job ID
if: failure()
id: get-job-id
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
brew install qemu vagrant
vagrant plugin install vagrant-qemu
# sudo softwareupdate --install-rosetta --agree-to-license
qemu-system-aarch64 -accel hvf
- name: Build ARM64 Vagrant Box
run: |
jobs=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs)
job_id=$(echo $jobs | jq -r '.jobs[] | select(.runner_name=="${{ runner.name }}") | .id')
echo "job_id=$job_id" >> $GITHUB_OUTPUT
- name: Send zulip message on failure
if: failure()
run: >-
curl -X POST https://submitty.zulipchat.com/api/v1/messages -u ${{ secrets.ZULIP_AUTHENTICATION }}
--data-urlencode 'type=stream'
--data-urlencode 'to=Submitty Developer Studio'
--data-urlencode 'topic=Vagrant Up Failures'
--data-urlencode 'content=The Package Vagrant VM Github Action has failed, this means the VM is not saved, and requires attention. View here: https://github.com/Submitty/Submitty/actions/runs/${{ github.run_id }}/job/${{ steps.get-job-id.outputs.job_id }}'
sudo pwpolicy -u runner -sethashtypes SMB-NT on
CI=1 vagrant up --provider=qemu

33 changes: 17 additions & 16 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ def gen_script(machine_name, worker: false, base: false)
reinstall = ENV.has_key?('VAGRANT_BOX') || base
extra = ENV.fetch('EXTRA', '')
setup_cmd = 'bash ${GIT_PATH}/.setup/'
if reinstall || ON_CI
if worker
setup_cmd += 'install_worker.sh'
else
setup_cmd += 'vagrant/setup_vagrant.sh'
if no_submissions
setup_cmd += ' --no_submissions'
end
end
else
setup_cmd += 'install_success_from_cloud.sh'
end
# if reinstall || ON_CI
# if worker
# setup_cmd += 'install_worker.sh'
# else
# setup_cmd += 'vagrant/setup_vagrant.sh'
# if no_submissions
# setup_cmd += ' --no_submissions'
# end
# end
# else
setup_cmd += 'install_success_from_cloud.sh'
# end
unless extra.empty?
setup_cmd += " #{extra}"
end
Expand Down Expand Up @@ -83,13 +83,13 @@ def mount_folders(config, mount_options)
# vagrant group so that they can write to this shared folder, primarily just for the log files
owner = 'root'
group = 'vagrant'
config.vm.synced_folder '.', '/usr/local/submitty/GIT_CHECKOUT/Submitty', create: true, owner: owner, group: group, mount_options: mount_options, smb_host: '10.0.2.2', smb_username: `whoami`.chomp
config.vm.synced_folder '.', '/usr/local/submitty/GIT_CHECKOUT/Submitty', create: true, owner: owner, group: group, mount_options: mount_options, smb_host: '10.0.2.2', smb_username: `whoami`.chomp, smb_password: `whoami`.chomp, disabled: true

optional_repos = %w(AnalysisTools AnalysisToolsTS Lichen RainbowGrades Tutorial CrashCourseCPPSyntax LichenTestData)
optional_repos.each {|repo|
repo_path = File.expand_path("../" + repo)
if File.directory?(repo_path)
config.vm.synced_folder repo_path, "/usr/local/submitty/GIT_CHECKOUT/" + repo, owner: owner, group: group, mount_options: mount_options, smb_host: '10.0.2.2', smb_username: `whoami`.chomp
config.vm.synced_folder repo_path, "/usr/local/submitty/GIT_CHECKOUT/" + repo, owner: owner, group: group, mount_options: mount_options, smb_host: '10.0.2.2', smb_username: `whoami`.chomp, smb_password: `whoami`.chomp, disabled: true
end
}
end
Expand Down Expand Up @@ -240,11 +240,12 @@ Vagrant.configure(2) do |config|

config.vm.provider "qemu" do |qe, override|
unless custom_box
if apple_silicon
if apple_silicon || ON_CI
override.vm.box = base_boxes[:arm_mac_qemu]
end
end


# qe.qemu_dir = "/usr/local/share/qemu"
qe.memory = "2G"
qe.smp = 2

Expand Down