Skip to content

Commit

Permalink
Try install without sudo (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Fingerhut <[email protected]>
  • Loading branch information
jafingerhut authored Jan 21, 2025
1 parent b14cf24 commit a6d548c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 11 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci-test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,22 @@ jobs:

- name: Build
run: |
sudo -E ./p4studio/p4studio profile apply ./p4studio/profiles/testing.yaml
./p4studio/p4studio profile apply ./p4studio/profiles/testing.yaml
- name: Show build logs
if: success() || failure()
run: |
./ci/show-build-logs.sh
- name: Run tests
run: |
# FIXME: Move these into a separate test suite.
sudo -E ENABLE_BF_ASM=TRUE make -C build tna_counter install
ENABLE_BF_ASM=TRUE make -C build tna_counter install
export SDE=`pwd`
export SDE_INSTALL="`pwd`/install"
sudo ${SDE_INSTALL}/bin/veth_setup.sh 128
sudo -E ./run_tofino_model.sh -p tna_counter --arch tofino -q |& sed 's/^/model: /' &
sudo -E ./run_switchd.sh -p tna_counter --arch tofino |& sed 's/^/switchd: /' &
sudo -E timeout 10800 ./run_p4_tests.sh -p tna_counter --arch tofino |& sed 's/^/tests: /'
./run_tofino_model.sh -p tna_counter --arch tofino -q |& sed 's/^/model: /' &
./run_switchd.sh -p tna_counter --arch tofino |& sed 's/^/switchd: /' &
timeout 10800 ./run_p4_tests.sh -p tna_counter --arch tofino |& sed 's/^/tests: /'
6 changes: 1 addition & 5 deletions batch-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ date
TIME_START=$(date +%s)
set -x

# This is required for some of the build steps, but is not installed
# by any later commands.
sudo apt-get install --yes ccache

set +x
echo "Version of p4lang/open-p4studio repo used:"
set -x
Expand All @@ -212,7 +208,7 @@ set -x
git log -n 1 | head -n 3
cd "${THIS_SCRIPT_DIR_ABSOLUTE}"

sudo -E ./p4studio/p4studio profile apply --jobs ${num_jobs} ./p4studio/profiles/testing.yaml
./p4studio/p4studio profile apply --jobs ${num_jobs} ./p4studio/profiles/testing.yaml

set +x
echo "------------------------------------------------------------"
Expand Down
53 changes: 53 additions & 0 deletions ci/show-build-logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#! /bin/bash

# Copyright (C) 2025 Andy Fingerhut
# SPDX-License-Identifier: Apache-2.0

# Basic system info
set -x
uname -a
nproc
cat /proc/meminfo
gcc --version

set +x
echo "------------------------------------------------------------"
echo "Info about Python binaries and packages installed."
echo "------------------------------------------------------------"
set -x
python3 -V
find . -name 'python3.*'
du install/lib

set +x
for f in p4studio/logs/*
do
set -x
wc $f
set +x
done

set +x
echo "------------------------------------------------------------"
echo "Occurrences of 'killed process' in dmesg logs are a likely sign"
echo "that a process was killed by the kernel due to the system running"
echo "our of memory, leading to unpredictable build failures."
echo "------------------------------------------------------------"
set -x
sudo dmesg -T | egrep -i 'killed process'

set +x
echo "------------------------------------------------------------"
echo "Full output of command: dmesg -T"
echo "------------------------------------------------------------"
set -x
sudo dmesg -T

set +x
for f in p4studio/logs/*
do
echo "------------------------------------------------------------"
echo "Contents of log file: $f"
echo "------------------------------------------------------------"
cat $f
done
2 changes: 1 addition & 1 deletion p4studio/dependencies/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ packages:
tags: [default, source]
type: source
thrift:
attributes: {flags: --with-cl="no" --with-java="no" --with-kotlin="no" --with-python="yes" --with-py3="yes" --with-ruby="no" --with-haxe="no" --with-netstd="no" --with-perl="no" --with-php="no" --with-php_extension="no" --with-dart="no" --with-erlang="no" --with-go="no" --with-d="no" --with-nodejs="no" --with-nodets="no" --with-lua="no" --with-rs="no" --with-swift="no" --enable-tests=no, url: 'https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz', version: 0.14.1}
attributes: {flags: --with-cl="no" --with-java="no" --with-kotlin="no" --with-python="yes" --with-py3="yes" --with-ruby="no" --with-haskell="no" --with-haxe="no" --with-netstd="no" --with-perl="no" --with-php="no" --with-php_extension="no" --with-dart="no" --with-erlang="no" --with-go="no" --with-d="no" --with-nodejs="no" --with-nodets="no" --with-lua="no" --with-rs="no" --with-swift="no" --enable-tests=no, url: 'https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz', version: 0.14.1}
tags: [default, source]
dependencies: [boost]
type: source

0 comments on commit a6d548c

Please sign in to comment.