forked from lf-edge/eden
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (117 loc) · 6.41 KB
/
eden_emh_arm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
name: EdenEMH_ARM
on: # yamllint disable-line rule:truthy
push:
branches-ignore:
- '**'
# yamllint disable rule:line-length
jobs:
integration:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
conf_eden_server: ["-l dfw2 -c c2.large.arm"]
conf_eve_server: ["-l dfw2 -c c2.large.arm"]
hv: ["kvm"]
steps:
- name: Setup packages
run: |
sudo rm -rf /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/microsoft-prod.list.save
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt install -y golang jq expect
- name: Get eden
uses: actions/[email protected]
- name: Create ubuntu server on packet hosting
id: ubuntu
run: |
packet_ubuntu_id=$(./shell-scripts/packet/create.sh ${{ matrix.conf_eden_server }} -p "$PACKET_PROJECT" -ns gh-action -os ubuntu_18_04)
packet_ubuntu_ip=$(./shell-scripts/packet/wait-eth0.sh $packet_ubuntu_id 100)
echo "Packet server ID: ${packet_ubuntu_id}"
echo "Packet server IP: ${packet_ubuntu_ip}"
echo "id=$packet_ubuntu_id" >> $GITHUB_OUTPUT
echo "ip=$packet_ubuntu_ip" >> $GITHUB_OUTPUT
echo "Waiting for the deployment to complete"
./shell-scripts/packet/wait-provisioning.sh $packet_ubuntu_id
sleep 100
env:
PACKET_TOKEN: ${{ secrets.PACKET_TOKEN }}
PACKET_PROJECT: ${{ secrets.PACKET_PROJECT }}
- name: Create SSH key
run: |
mkdir -p ~/.ssh/keys/
echo "$SSH_PRIVATE_KEY" > "$SSH_KEY_PATH"
sudo chmod 600 "$SSH_KEY_PATH"
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
./shell-scripts/packet/ssh-add.sh "$SSH_KEY_PATH" "$SSH_PASSPHRASE"
ssh-keyscan -H ${{steps.ubuntu.outputs.ip}} > ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{secrets.PACKET_SSH_KEY}}
SSH_PASSPHRASE: ${{secrets.PACKET_SSH_PASSPHRASE}}
SSH_KEY_PATH: ${{ github.workspace }}/../private.key
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Install Dependencies to packet ubuntu server for EDEN
run: |
ssh root@${{steps.ubuntu.outputs.ip}} 'sudo apt-get update && sudo apt-get remove docker docker-engine docker.io containerd runc'
ssh root@${{steps.ubuntu.outputs.ip}} 'sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release'
ssh root@${{steps.ubuntu.outputs.ip}} 'curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --no-tty --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg'
ssh root@${{steps.ubuntu.outputs.ip}} 'echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null'
ssh root@${{steps.ubuntu.outputs.ip}} 'sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io'
ssh root@${{steps.ubuntu.outputs.ip}} 'sudo apt-get install -y jq make git expect qemu binfmt-support qemu-user-static qemu-utils qemu-system-x86 qemu-system-aarch64'
ssh root@${{steps.ubuntu.outputs.ip}} 'sudo add-apt-repository ppa:longsleep/golang-backports && sudo apt install -y golang'
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Get and setup EDEN on ubuntu packet server
run: |
ssh root@${{steps.ubuntu.outputs.ip}} 'sudo rm -rf ~/eden'
ssh root@${{steps.ubuntu.outputs.ip}} 'git clone https://github.com/lf-edge/eden.git && cd eden && git checkout '"$GITHUB_SHA"
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && make clean && make build && make build-tests'
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden config add --devmodel=general --arch=arm64'
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden config set default --key eve.hv --value='"${{ matrix.hv }}"
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden setup -v debug --netboot=true'
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden start'
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Create EVE server on packet hosting
id: eve
run: |
device_id=$(ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && export PACKET_TOKEN='"$PACKET_TOKEN"' && ./shell-scripts/packet/create-eve.sh'" ${{ matrix.conf_eve_server }} -p $PACKET_PROJECT"' -ns eve-gh-action')
device_ip=$(ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && export PACKET_TOKEN='"$PACKET_TOKEN"' && ./shell-scripts/packet/wait-eth0.sh '"$device_id"' 200')
echo "Packet EVE ID: $device_id"
echo "Packet EVE IP: $device_ip"
echo "id=$device_id" >> $GITHUB_OUTPUT
echo "Waiting for the deployment to complete"
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && export PACKET_TOKEN='"$PACKET_TOKEN"' && ./shell-scripts/packet/wait-provisioning.sh '"$device_id"
sleep 100
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
PACKET_TOKEN: ${{ secrets.PACKET_TOKEN }}
PACKET_PROJECT: ${{ secrets.PACKET_PROJECT }}
- name: Onboard EVE and run test
run: |
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden eve onboard'
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && EDEN_TEST=gcp EDEN_TEST_REGISTRY=n ./eden test tests/workflow -v debug'
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Collect logs
if: ${{ always() }}
run: |
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden log --format json' > trace.log
ssh root@${{steps.ubuntu.outputs.ip}} 'cd eden && ./eden info' > info.log
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Terminate packet servers
if: ${{ always() }}
run: |
./shell-scripts/packet/delete.sh ${{steps.ubuntu.outputs.id}}
./shell-scripts/packet/delete.sh ${{steps.eve.outputs.id}}
env:
PACKET_TOKEN: ${{ secrets.PACKET_TOKEN }}
- name: Store raw test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: eden-packet${{ matrix.conf_eden_server }}---eve-packet${{ matrix.conf_eve_server }}-${{ matrix.hv }}
path: |
${{ github.workspace }}/trace.log
${{ github.workspace }}/info.log