Remove Agent Debug Info (#187126)

## Summary

- Removes SSH info to avoid confusion since we cannot SSH into agents on
the new infra
- Removes old agent metrics and logs links because they are in a
different cluster and the new links are in an annotation
This commit is contained in:
Brad White 2024-07-08 15:10:14 -06:00 committed by GitHub
parent cecdf31039
commit dd9d6434ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 64 deletions

View file

@ -6,13 +6,6 @@ echo '--- Log out of gcloud'
./.buildkite/scripts/common/activate_service_account.sh --unset-impersonation || echo "Failed to unset impersonation"
./.buildkite/scripts/common/activate_service_account.sh --logout-gcloud || echo "Failed to log out of gcloud"
if [[ "${SKIP_NODE_SETUP:-}" =~ ^(1|true)$ ]]; then
echo '--- Skipping Agent Debug Info'
else
echo '--- Agent Debug Info'
ts-node .buildkite/scripts/lifecycle/print_agent_links.ts || true
fi
IS_TEST_EXECUTION_STEP="$(buildkite-agent meta-data get "${BUILDKITE_JOB_ID}_is_test_execution_step" --default '')"
if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then

View file

@ -11,16 +11,6 @@ if [[ "${SKIP_NODE_SETUP:-}" =~ ^(1|true)$ ]]; then
else
source .buildkite/scripts/common/setup_node.sh
source .buildkite/scripts/common/setup_buildkite_deps.sh
echo '--- Agent Debug/SSH Info'
ts-node .buildkite/scripts/lifecycle/print_agent_links.ts || true
fi
if [[ "$(curl -is metadata.google.internal || true)" ]]; then
echo ""
echo "To SSH into this agent, run:"
echo "gcloud compute ssh --tunnel-through-iap --project elastic-kibana-ci --zone \"$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/zone)\" \"$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/name)\""
echo ""
fi
if [[ "${BUILDKITE_LABEL:-}" == *"Run Dynamic Pipeline"* || "${BUILDKITE_LABEL:-}" == *"Upload Pipeline"* ]]; then

View file

@ -1,47 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { BuildkiteClient } from '#pipeline-utils';
(async () => {
try {
const client = new BuildkiteClient();
const build = await client.getCurrentBuild();
const job = build.jobs.find((j) => j.id === process.env.BUILDKITE_JOB_ID);
const startTime = job
? new Date(job.started_at)
: new Date(new Date().getTime() - 60 * 60 * 1000);
const twoHours = new Date(startTime.getTime() + 2 * 60 * 60 * 1000);
const METRICS_URL = [
`https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`,
`/app/metrics/link-to/host-detail/${process.env.BUILDKITE_AGENT_NAME}`,
`?to=${twoHours.getTime()}`,
`&from=${startTime.getTime()}`,
].join('');
const LOGS_URL = [
`https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`,
`/app/logs/link-to/host-logs/${process.env.BUILDKITE_AGENT_NAME}`,
`?time=${startTime.getTime()}`,
].join('');
console.log('Agent Metrics:');
console.log('\u001b]1339;' + `url='${METRICS_URL}'\u0007`);
console.log('Agent Logs:');
console.log('\u001b]1339;' + `url='${LOGS_URL}'\u0007`);
} catch (ex) {
// Probably don't need to fail the build for this failure, just log it
console.error('Buildkite API Error', ex.message);
if (ex.response) {
console.error('HTTP Error Response Status', ex.response.status);
console.error('HTTP Error Response Body', ex.response.data);
}
}
})();