Skip to content

Commit 5ca6791

Browse files
authored
Merge branch 'master' into rbirkner/revert-sev-update-relaxation
2 parents 257ddcd + a61df4d commit 5ca6791

92 files changed

Lines changed: 3409 additions & 726 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/schedule-daily.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
129129
# Run SEV tests
130130
bazel test //rs/tests/nested:guestos_upgrade_from_latest_release_to_current_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)"
131+
bazel test //rs/tests/nested:hostos_upgrade_from_latest_release_to_current_sev --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)"
131132
bazel test //rs/tests/nested:sev_recovery --test_env=BARE_METAL_HOST_SECRETS="$(realpath file1)"
132133
133134
bazel clean

Cargo.lock

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/scripts/targets.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#
55
# This script determines which Bazel targets should be built or tested and writes them separated by newlines to stdout.
66
#
7-
# If --base is passed only include targets with modified inputs in `git diff --name-only --merge-base $BASE $HEAD`.
8-
# When --head is not provided defaults to HEAD.
7+
# If --base is passed only include targets with modified inputs in `git diff --name-only --merge-base $BASE [$HEAD]`.
8+
# where `$HEAD` is from --head if specified.
99
#
1010
# If --skip_long_tests is passed, tests tagged with 'long_test' will be excluded.
1111
#
@@ -110,15 +110,20 @@ def load_explicit_targets() -> dict[str, Set[str]]:
110110
return explicit_targets_dict
111111

112112

113-
def diff_only_query(command: str, base: str, head: str, skip_long_tests: bool) -> str:
113+
def diff_only_query(command: str, base: str, head: str | None, skip_long_tests: bool) -> str:
114114
"""
115-
Return a bazel query for all targets that have modified inputs in the specified git commit range. Taking into account:
115+
Return a bazel query for all targets that have modified inputs in the specified git commit range.
116+
If `head` is not specified it diffs against the working tree which is useful for testing locally.
117+
It takes into account:
116118
* To return all targets in case files matching ALL_TARGETS_BLOBS are modified.
117119
* To only include test targets in case the bazel command was 'test'.
118120
* To exclude long_tests if requested.
119121
"""
120122
modified_files = subprocess.run(
121-
["git", "diff", "--name-only", "--merge-base", base, head], check=True, capture_output=True, text=True
123+
["git", "diff", "--name-only", "--merge-base", base] + ([head] if head is not None else []),
124+
check=True,
125+
capture_output=True,
126+
text=True,
122127
).stdout.splitlines()
123128

124129
n = len(modified_files)
@@ -187,7 +192,7 @@ def targets(
187192
query = (
188193
("//..." + (" except attr(tags, long_test, //...)" if skip_long_tests else ""))
189194
if base is None
190-
else diff_only_query(command, base, "HEAD" if head is None else head, skip_long_tests)
195+
else diff_only_query(command, base, head, skip_long_tests)
191196
)
192197

193198
# Finally, exclude targets that have any of the excluded tags:
@@ -277,7 +282,7 @@ def main():
277282
)
278283
parser.add_argument(
279284
"--base",
280-
help="Only include targets with modified inputs in `git diff --name-only --merge-base $BASE $HEAD`. When --head is not provided defaults to HEAD.",
285+
help="Only include targets with modified inputs in `git diff --name-only --merge-base $BASE [$HEAD]` where $HEAD is from --head if specified.",
281286
)
282287
parser.add_argument("--head", help="See --base.")
283288
args = parser.parse_args()

ic-os/components/early-boot/fstab/fstab-guestos

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ tmpfs /tmp tmpfs defaults 0 2
33
/dev/disk/by-partuuid/b78084e2-3363-1346-8c25-d426f26b8928 /boot/efi vfat defaults 0 2
44
/dev/disk/by-partuuid/6788e4cf-f456-104e-9a34-a2c58cfb0ee6 /boot/grub vfat defaults 0 2
55
/dev/disk/by-partuuid/a5ba3816-beaa-d74d-993e-cfa5aa6ba1f6 /boot/config ext4 defaults,sync 0 2
6-
/dev/mapper/var_crypt /var ext4 defaults 0 2
6+
# Remove the BindsTo on the underlying crypt device. We suspect the device flapping in udev can lead to the mount locking up.
7+
/dev/mapper/var_crypt /var ext4 defaults,x-systemd.device-bound=false 0 2
78
# If you add a new mount that depends on /dev/mapper/store, don't forget to add it to maybe-disable-store-mounts.service
89
/dev/mapper/store-shared--backup /var/lib/ic/backup ext4 defaults,context=system_u:object_r:ic_data_t:s0 0 2
910
/dev/mapper/store-shared--crypto /var/lib/ic/crypto ext4 defaults 0 2

ic-os/components/guestos/ic-btc-adapter/generate-btc-adapter-config.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ source /opt/ic/bin/config.sh
1010

1111
function read_config_variables() {
1212
config_bitcoind_addr=$(get_config_value '.guestos_settings.guestos_dev_settings.bitcoind_addr')
13-
config_socks_proxy=$(get_config_value '.guestos_settings.guestos_dev_settings.socks_proxy')
1413
}
1514

1615
function usage() {
@@ -43,13 +42,6 @@ done
4342

4443
read_config_variables
4544

46-
# Production socks5 proxy url needs to include schema, host and port to be accepted by the adapters.
47-
# Testnets deploy with a development socks_proxy config value to overwrite the production socks proxy with the testnet proxy.
48-
SOCKS_PROXY="socks5://socks5.ic0.app:1080"
49-
if [ "${config_socks_proxy}" != "" ] && [ "${config_socks_proxy}" != "null" ]; then
50-
SOCKS_PROXY="${config_socks_proxy}"
51-
fi
52-
5345
BITCOIN_NETWORK='"testnet4"'
5446
DNS_SEEDS='"seed.testnet4.bitcoin.sprovoost.nl",
5547
"seed.testnet4.wiz.biz"'
@@ -72,7 +64,7 @@ if [ "${OUT_FILE}" == "" ]; then
7264
exit 1
7365
fi
7466

75-
# config_bitcoind_addr indicates that we are in system test environment. No socks proxy needed.
67+
# config_bitcoind_addr indicates that we are in system test environment.
7668
if [ "${config_bitcoind_addr}" != "" ] && [ "${config_bitcoind_addr}" != "null" ]; then
7769
echo '{
7870
"network": "regtest",

ic-os/components/guestos/ic-btc-adapter/generate-doge-adapter-config.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ source /opt/ic/bin/config.sh
1010

1111
function read_config_variables() {
1212
config_dogecoind_addr=$(get_config_value '.guestos_settings.guestos_dev_settings.dogecoind_addr')
13-
config_socks_proxy=$(get_config_value '.guestos_settings.guestos_dev_settings.socks_proxy')
1413
}
1514

1615
function usage() {
@@ -43,13 +42,6 @@ done
4342

4443
read_config_variables
4544

46-
# Production socks5 proxy url needs to include schema, host and port to be accepted by the adapters.
47-
# Testnets deploy with a development socks_proxy config value to overwrite the production socks proxy with the testnet proxy.
48-
SOCKS_PROXY="socks5://socks5.ic0.app:1080"
49-
if [ "${config_socks_proxy}" != "" ] && [ "${config_socks_proxy}" != "null" ]; then
50-
SOCKS_PROXY="${config_socks_proxy}"
51-
fi
52-
5345
DOGECOIN_NETWORK='"dogecoin:testnet"'
5446
CACHE_NAME='dogecoin_testnet_cache'
5547
DNS_SEEDS='"jrn.me.uk",
@@ -67,7 +59,7 @@ if [ "${OUT_FILE}" == "" ]; then
6759
exit 1
6860
fi
6961

70-
# config_dogecoind_addr indicates that we are in system test environment. No socks proxy needed.
62+
# config_dogecoind_addr indicates that we are in system test environment.
7163
if [ "${config_dogecoind_addr}" != "" ] && [ "${config_dogecoind_addr}" != "null" ]; then
7264
echo '{
7365
"network": "dogecoin:regtest",

ic-os/components/guestos/init/setup-encryption/systemd-fsck@dev-mapper-var_crypt.service

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# This unit is overridden to remove the BindsTo on the underlying crypt device.
2-
# Otherwise, it is the same as the systemd generated default. We suspect the
3-
# device flapping in udev can lead to the mount locking up.
1+
# This unit is overridden to replace the BindsTo on the underlying crypt device
2+
# with Requires. Otherwise, it is the same as the systemd generated default. We
3+
# suspect the device flapping in udev can lead to the mount locking up.
44

55
[Unit]
66
Description=File System Check on /dev/mapper/var_crypt
77
Documentation=man:systemd-fsck@.service(8)
88
DefaultDependencies=no
9+
Requires=dev-mapper-var_crypt.device
910
Conflicts=shutdown.target
1011
Wants=systemd-fsckd.socket
1112
After=dev-mapper-var_crypt.device systemd-fsck-root.service local-fs-pre.target systemd-fsckd.socket

ic-os/components/setupos/check-hardware.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function check_num_cpus() {
7777
local cpu_json="$1"
7878
local required_sockets="$2"
7979

80-
local num_cpu_sockets=$(echo "${cpu_json}" | jq -r '.[].id' | wc -l)
80+
local num_cpu_sockets=$(echo "${cpu_json}" | jq -r '.[] | select(has("disabled") | not) | .id' | wc -l)
8181
log_and_halt_installation_on_error "$?" "Unable to extract CPU sockets from CPU JSON."
8282

8383
if [ "${num_cpu_sockets}" -lt "${required_sockets}" ]; then
@@ -89,7 +89,7 @@ function verify_capability_for_all_sockets() {
8989
local cpu_json="$1"
9090
local capability_name="$2"
9191

92-
for socket_id in $(echo "${cpu_json}" | jq -r '.[].id'); do
92+
for socket_id in $(echo "${cpu_json}" | jq -r '.[] | select(has("disabled") | not) | .id'); do
9393
local capability=$(echo "${cpu_json}" | jq -r \
9494
--arg socket "${socket_id}" \
9595
--arg capability "${capability_name}" \
@@ -112,7 +112,7 @@ function verify_model_for_all_sockets() {
112112
local cpu_json="$1"
113113
local required_model="$2"
114114

115-
for socket_id in $(echo "${cpu_json}" | jq -r '.[].id'); do
115+
for socket_id in $(echo "${cpu_json}" | jq -r '.[] | select(has("disabled") | not) | .id'); do
116116
local model=$(echo "${cpu_json}" | jq -r --arg socket "${socket_id}" '.[] | select(.id==$socket) | .product')
117117

118118
echo -n "* CPU model '${model}' "

ic-os/components/setupos/test-setupos.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,26 @@ function test_verify_cpu() {
130130
]' 64 1
131131

132132
# Gen3 Success
133-
test_verify_cpu_helper "verify_cpu Gen3 success" "3" '[
133+
134+
## AMD SVM 2 sockets
135+
test_verify_cpu_helper "verify_cpu Gen3 success AMD" "3" '[
134136
{"id": "cpu:0", "product": "Foobar CPU", "capabilities": {"svm": "true"}},
135137
{"id": "cpu:1", "product": "Foobaz CPU", "capabilities": {"svm": "true"}}
136138
]' 1 0
137139

138-
test_verify_cpu_helper "verify_cpu Gen3 success" "3" '[
139-
{"id": "cpu:0", "product": "Foobar CPU", "capabilities": {"vmx": "true"}},
140+
## Intel VMX 1 socket
141+
test_verify_cpu_helper "verify_cpu Gen3 success Intel" "3" '[
142+
{"id": "cpu:0", "product": "Foobar CPU", "capabilities": {"vmx": "true"}}
143+
]' 1 0
144+
145+
## One unpopulated socket ignored
146+
test_verify_cpu_helper "verify_cpu Gen3 success AMD 1 socket unpopulated" "3" '[
147+
{"id": "cpu:0", "product": "Foobar CPU", "capabilities": {"svm": "true"}},
148+
{"id": "cpu:1", "product": "Foobaz CPU", "disabled": true}
140149
]' 1 0
141150

142151
# Gen3 Failure
152+
## Missing caps
143153
test_verify_cpu_helper "verify_cpu Gen3 failure" "3" '[
144154
{"id": "cpu:0", "product": "Foobar CPU", "capabilities": {}},
145155
{"id": "cpu:1", "product": "Foobaz CPU", "capabilities": {}}

ic-os/guestos/context/Dockerfile.base

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ COPY packages.* /tmp/
6262
RUN apt-get -y update && \
6363
apt-get -y upgrade && \
6464
apt-get -y --no-install-recommends install $(for P in ${PACKAGE_FILES}; do cat /tmp/$P | sed -e "s/#.*//" ; done) \
65-
${_KERNEL_PACKAGE} \
66-
linux-modules-extra-$(apt-cache depends ${_KERNEL_PACKAGE} | sed -n -e 's/ Depends: linux-image-\(.*\)-generic/\1/p')-generic && \
65+
# TODO(NODE-1852): Temporarily pin the kernel here.
66+
# ${_KERNEL_PACKAGE} \
67+
# linux-modules-extra-$(apt-cache depends ${_KERNEL_PACKAGE} | sed -n -e 's/ Depends: linux-image-\(.*\)-generic/\1/p')-generic && \
68+
linux-image-6.14.0-37-generic linux-modules-extra-6.14.0-37-generic && \
6769
rm /tmp/packages.*
6870

6971
# Install node_exporter

0 commit comments

Comments
 (0)