Compare commits

Author SHA1 Message Date
AlejandroCabeza cd4041293a chore: add rust-libp2p@v0.55.0 to perf 2025-01-16 00:58:52 +00:00
AlejandroCabeza 434938271f chore: add rust-libp2p@v0.54.0 to perf 2024-08-23 00:58:40 +00:00
12 changed files with 100 additions and 68 deletions
@@ -86,11 +86,6 @@ runs:
- name: Load cache and build
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
env:
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
AWS_REGION: ${{ inputs.aws-region }}
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
run: npm run cache -- load
shell: bash
@@ -78,11 +78,6 @@ runs:
- name: Load cache and build
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
env:
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
AWS_REGION: ${{ inputs.aws-region }}
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
run: npm run cache -- load
shell: bash
@@ -78,11 +78,6 @@ runs:
- name: Load cache and build
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
env:
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
AWS_REGION: ${{ inputs.aws-region }}
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
run: npm run cache -- load
shell: bash
+3 -3
View File
@@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/run-interop-hole-punch-test
with:
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
worker-count: 16
+4 -4
View File
@@ -18,12 +18,12 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/run-transport-interop-test
with:
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
worker-count: 16
build-without-secrets:
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Purposely not using secrets to replicate how forks will behave.
+1 -1
View File
@@ -1,6 +1,6 @@
# Interoperability/end to end test-plans & performance benchmarking for libp2p
[![Interop Dashboard](https://github.com/vacp2p/libp2p-test-plans/workflows/libp2p%20transport%20interop%20test/badge.svg?branch=master)](https://github.com/vacp2p/libp2p-test-plans/actions/runs/10508587062/attempts/1#summary-29112802717)
[![Interop Dashboard](https://github.com/status-im/libp2p-test-plans/workflows/libp2p%20transport%20interop%20test/badge.svg?branch=master)](https://github.com/status-im/libp2p-test-plans/actions/runs/7043365318/attempts/1#summary-19169013615)
[![Made by Protocol Labs](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
-5
View File
@@ -1,5 +0,0 @@
{
"opRetro": {
"projectId": "0x966804cb492e1a4bde5d781a676a44a23d69aa5dd2562fa7a4f95bb606021c8b"
}
}
+16 -20
View File
@@ -1,9 +1,8 @@
const AWS_BUCKET = process.env.AWS_BUCKET;
const AWS_BUCKET = process.env.AWS_BUCKET || 'libp2p-by-tf-aws-bootstrap';
const scriptDir = __dirname;
import * as crypto from 'crypto';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as child_process from 'child_process';
import ignore, { Ignore } from 'ignore'
@@ -77,14 +76,10 @@ async function loadCacheOrBuild(dir: string, ig: Ignore) {
if (mode == Mode.PushCache) {
console.log("Pushing cache")
try {
if (!AWS_BUCKET) {
throw new Error("AWS_BUCKET not set")
}
try {
child_process.execSync(`aws s3 ls s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`)
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, {method: "HEAD"})
if (res.ok) {
console.log("Cache already exists")
} catch (e) {
console.log("Cache doesn't exist", e)
} else {
// Read image id from image.json
const imageID = JSON.parse(fs.readFileSync(path.join(dir, 'image.json')).toString()).imageID;
console.log(`Pushing cache for ${dir}: ${imageID}`)
@@ -101,17 +96,18 @@ async function loadCacheOrBuild(dir: string, ig: Ignore) {
console.log("Loading cache")
let cacheHit = false
try {
if (!AWS_BUCKET) {
throw new Error("AWS_BUCKET not set")
}
const cachePath = fs.mkdtempSync(path.join(os.tmpdir(), 'cache'))
const archivePath = path.join(cachePath, 'archive.tar.gz')
const dockerLoadedMsg = child_process.execSync(`aws s3 cp s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz ${archivePath} && docker image load -i ${archivePath}`).toString();
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
if (loadedImageId) {
console.log(`Cache hit for ${loadedImageId}`);
fs.writeFileSync(path.join(dir, 'image.json'), JSON.stringify({imageID: loadedImageId}) + "\n");
cacheHit = true
// Check if the cache exists
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, {method: "HEAD"})
if (res.ok) {
const dockerLoadedMsg = child_process.execSync(`curl https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz | docker image load`).toString();
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
if (loadedImageId) {
console.log(`Cache hit for ${loadedImageId}`);
fs.writeFileSync(path.join(dir, 'image.json'), JSON.stringify({imageID: loadedImageId}) + "\n");
cacheHit = true
}
} else {
console.log("Cache not found")
}
} catch (e) {
console.log("Cache not found:", e)
+22
View File
@@ -0,0 +1,22 @@
commitSha :=
all: perf
perf: rust-libp2p-${commitSha}/target/release/perf
cp ./rust-libp2p-${commitSha}/target/release/perf .
rust-libp2p-${commitSha}/target/release/perf: rust-libp2p-${commitSha}
docker run --rm --user "$(shell id -u):$(shell id -g)" -v "$(shell pwd)/rust-libp2p-${commitSha}":/usr/src/myapp -w /usr/src/myapp rust:1.73 cargo build --release --bin perf
rust-libp2p-${commitSha}: rust-libp2p-${commitSha}.zip
unzip -o rust-libp2p-${commitSha}.zip
rust-libp2p-${commitSha}.zip:
wget -O $@ "https://github.com/libp2p/rust-libp2p/archive/${commitSha}.zip"
clean:
rm rust-libp2p-*.zip
rm -rf rust-libp2p-*
rm perf
.PHONY: all clean
+22
View File
@@ -0,0 +1,22 @@
commitSha :=
all: perf
perf: rust-libp2p-${commitSha}/target/release/perf
cp ./rust-libp2p-${commitSha}/target/release/perf .
rust-libp2p-${commitSha}/target/release/perf: rust-libp2p-${commitSha}
docker run --rm --user "$(shell id -u):$(shell id -g)" -v "$(shell pwd)/rust-libp2p-${commitSha}":/usr/src/myapp -w /usr/src/myapp rust:1.73 cargo build --release --bin perf
rust-libp2p-${commitSha}: rust-libp2p-${commitSha}.zip
unzip -o rust-libp2p-${commitSha}.zip
rust-libp2p-${commitSha}.zip:
wget -O $@ "https://github.com/libp2p/rust-libp2p/archive/${commitSha}.zip"
clean:
rm rust-libp2p-*.zip
rm -rf rust-libp2p-*
rm perf
.PHONY: all clean
+16
View File
@@ -66,5 +66,21 @@
"transportStacks": [
"tcp"
]
},
{
"id": "v0.54",
"implementation": "rust-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
},
{
"id": "v0.55",
"implementation": "rust-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
}
]
+16 -20
View File
@@ -1,9 +1,8 @@
const AWS_BUCKET = process.env.AWS_BUCKET;
const AWS_BUCKET = process.env.AWS_BUCKET || 'libp2p-by-tf-aws-bootstrap';
const scriptDir = __dirname;
import * as crypto from 'crypto';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as child_process from 'child_process';
import ignore, { Ignore } from 'ignore'
@@ -66,14 +65,10 @@ switch (modeStr) {
if (mode == Mode.PushCache) {
console.log("Pushing cache")
try {
if (!AWS_BUCKET) {
throw new Error("AWS_BUCKET not set")
}
try {
child_process.execSync(`aws s3 ls s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`)
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, { method: "HEAD" })
if (res.ok) {
console.log("Cache already exists")
} catch (e) {
console.log("Cache doesn't exist", e)
} else {
// Read image id from image.json
const imageID = JSON.parse(fs.readFileSync(path.join(implFolder, 'image.json')).toString()).imageID;
console.log(`Pushing cache for ${impl}: ${imageID}`)
@@ -90,17 +85,18 @@ switch (modeStr) {
console.log("Loading cache")
let cacheHit = false
try {
if (!AWS_BUCKET) {
throw new Error("AWS_BUCKET not set")
}
const cachePath = fs.mkdtempSync(path.join(os.tmpdir(), 'cache'))
const archivePath = path.join(cachePath, 'archive.tar.gz')
const dockerLoadedMsg = child_process.execSync(`aws s3 cp s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz ${archivePath} && docker image load -i ${archivePath}`).toString();
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
if (loadedImageId) {
console.log(`Cache hit for ${loadedImageId}`);
fs.writeFileSync(path.join(implFolder, 'image.json'), JSON.stringify({ imageID: loadedImageId }) + "\n");
cacheHit = true
// Check if the cache exists
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, { method: "HEAD" })
if (res.ok) {
const dockerLoadedMsg = child_process.execSync(`curl https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz | docker image load`).toString();
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
if (loadedImageId) {
console.log(`Cache hit for ${loadedImageId}`);
fs.writeFileSync(path.join(implFolder, 'image.json'), JSON.stringify({ imageID: loadedImageId }) + "\n");
cacheHit = true
}
} else {
console.log("Cache not found")
}
} catch (e) {
console.log("Cache not found:", e)