diff --git a/.buildkite/scripts/lifecycle/post_command.sh b/.buildkite/scripts/lifecycle/post_command.sh index e5bc6b5e3a63c..aba90439effc6 100755 --- a/.buildkite/scripts/lifecycle/post_command.sh +++ b/.buildkite/scripts/lifecycle/post_command.sh @@ -6,9 +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" -echo '--- Agent Debug Info' -node .buildkite/scripts/lifecycle/print_agent_links.js || true - IS_TEST_EXECUTION_STEP="$(buildkite-agent meta-data get "${BUILDKITE_JOB_ID}_is_test_execution_step" --default '')" if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index dd5a23cee14b9..ad08e4af49a65 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -12,13 +12,3 @@ else source .buildkite/scripts/common/setup_node.sh source .buildkite/scripts/common/setup_buildkite_deps.sh fi - -echo '--- Agent Debug/SSH Info' -node .buildkite/scripts/lifecycle/print_agent_links.js || true - -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 diff --git a/.buildkite/scripts/lifecycle/print_agent_links.js b/.buildkite/scripts/lifecycle/print_agent_links.js deleted file mode 100644 index 1e3b6fd10fa9b..0000000000000 --- a/.buildkite/scripts/lifecycle/print_agent_links.js +++ /dev/null @@ -1,46 +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. - */ - -// eslint-disable-next-line import/no-unresolved -const { BuildkiteClient } = require('kibana-buildkite-library'); - -(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().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); - } - } -})();