From a9e0b277729277ea042e55124aaa147608700372 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 1 Jul 2018 17:01:31 -0700 Subject: [PATCH] Speed up snap build 1. Use pre-installed host rust toolchain 2. Build reference/performance fullnode in same part to avoid rebuilding libraries 3. Merge scripts into same part --- ci/buildkite-snap.yml | 2 +- ci/buildkite.yml | 2 +- snap/snapcraft.yaml | 43 +++++++++++++++++-------------------------- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/ci/buildkite-snap.yml b/ci/buildkite-snap.yml index 4122f754d8..bf4ee218a5 100644 --- a/ci/buildkite-snap.yml +++ b/ci/buildkite-snap.yml @@ -1,4 +1,4 @@ steps: - command: "ci/snap.sh" - timeout_in_minutes: 30 + timeout_in_minutes: 20 name: "snap [public]" diff --git a/ci/buildkite.yml b/ci/buildkite.yml index fc125e67b3..105a7c4361 100644 --- a/ci/buildkite.yml +++ b/ci/buildkite.yml @@ -24,7 +24,7 @@ steps: agents: - "queue=cuda" - command: "ci/pr-snap.sh" - timeout_in_minutes: 30 + timeout_in_minutes: 20 name: "snap [public]" - wait - command: "ci/publish-crate.sh" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index bb720dee27..437afee6c9 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -59,41 +59,32 @@ apps: command: drone.sh parts: - solana-rsync: + solana: plugin: nil - override-build: | - # TODO: build rsync from source instead of sneaking it in from the host - # system... - set -x - mkdir -p $SNAPCRAFT_PART_INSTALL/bin - cp -av /usr/bin/rsync $SNAPCRAFT_PART_INSTALL/bin/ - - solana-scripts: - plugin: nil - override-build: | - set -x - mkdir -p $SNAPCRAFT_PART_INSTALL/bin - cp -av multinode-demo/* $SNAPCRAFT_PART_INSTALL/bin/ - - solana-cuda: - plugin: rust - rust-channel: stable - rust-features: - - erasure - - cuda prime: - - bin/solana-fullnode-cuda + - bin - usr/lib/libgf_complete.so.1 - usr/lib/libJerasure.so.2 override-build: | + # Build/install solana-fullnode-cuda ./fetch-perf-libs.sh - snapcraftctl build + cargo install --features=cuda,erasure --root $SNAPCRAFT_PART_INSTALL --bin solana-fullnode mv $SNAPCRAFT_PART_INSTALL/bin/solana-fullnode $SNAPCRAFT_PART_INSTALL rm -rf $SNAPCRAFT_PART_INSTALL/bin/* mv $SNAPCRAFT_PART_INSTALL/solana-fullnode $SNAPCRAFT_PART_INSTALL/bin/solana-fullnode-cuda mkdir -p $SNAPCRAFT_PART_INSTALL/usr/lib/ cp -f libJerasure.so $SNAPCRAFT_PART_INSTALL/usr/lib/libJerasure.so.2 cp -f libgf_complete.so $SNAPCRAFT_PART_INSTALL/usr/lib/libgf_complete.so.1 - solana: - plugin: rust - rust-channel: stable + + # Build/install all other programs + cargo install --root $SNAPCRAFT_PART_INSTALL --bins + + # Install multinode scripts + mkdir -p $SNAPCRAFT_PART_INSTALL/bin + cp -av multinode-demo/* $SNAPCRAFT_PART_INSTALL/bin/ + + # TODO: build rsync from source instead of sneaking it in from the host + # system... + set -x + mkdir -p $SNAPCRAFT_PART_INSTALL/bin + cp -av /usr/bin/rsync $SNAPCRAFT_PART_INSTALL/bin/