This repository was archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
feat: enable SSH access to users for debugging cloud instances (#2001) backport for 7.16 #2032
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| adam-stokes | ||
| mdelapenya |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| - name: Install SSH keys | ||
| become: false | ||
| shell: | | ||
| /home/{{ansible_user}}/e2e-testing/.ci/scripts/import-ssh-keys.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env groovy | ||
|
|
||
| @Library('apm@current') _ | ||
|
|
||
| pipeline { | ||
| agent { label 'ubuntu-20' } | ||
| environment { | ||
| HOME = "${env.WORKSPACE}" | ||
| NOTIFY_TO = credentials('notify-to') | ||
| PIPELINE_LOG_LEVEL = 'INFO' | ||
| JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba" | ||
| AWS_PROVISIONER_SECRET = 'secret/observability-team/ci/elastic-observability-aws-account-auth' | ||
| AWS_EC2_INSTANCES_TAG_NAME= 'ReaperMark' | ||
| AWS_EC2_INSTANCES_TAG_VALUE= 'e2e-testing-vm' | ||
| } | ||
| options { | ||
| timeout(time: 1, unit: 'HOURS') | ||
| buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20')) | ||
| timestamps() | ||
| ansiColor('xterm') | ||
| disableResume() | ||
| durabilityHint('PERFORMANCE_OPTIMIZED') | ||
| rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true]) | ||
| quietPeriod(10) | ||
| } | ||
| triggers { | ||
| cron '0 0 * * 0' | ||
| } | ||
| stages { | ||
| stage('Reap AWS instances'){ | ||
| steps { | ||
| withAWSEnv(secret: "${env.AWS_PROVISIONER_SECRET}", forceInstallation: true) { | ||
| sh("aws ec2 terminate-instances --instance-ids `aws ec2 describe-instances --filters Name=tag:${env.AWS_EC2_INSTANCES_TAG_NAME},Values=${env.AWS_EC2_INSTANCES_TAG_VALUE} --query Reservations[].Instances[].InstanceId --output text`") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| post { | ||
| cleanup { | ||
| notifyBuildResult() | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| - job: | ||
| name: e2e-tests/aws-instances-reaper | ||
| display-name: AWS Instances Reaper | ||
| description: Job to remove cloud resources on Sundays | ||
| view: Beats | ||
| project-type: pipeline | ||
| pipeline-scm: | ||
| script-path: .ci/aws-instances-reaper.groovy | ||
| scm: | ||
| - git: | ||
| url: git@github.com:elastic/e2e-testing.git | ||
| refspec: +refs/heads/*:refs/remotes/origin/* | ||
| wipe-workspace: true | ||
| name: origin | ||
| shallow-clone: true | ||
| credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba | ||
| reference-repo: /var/lib/jenkins/.git-references/e2e-testing.git | ||
| branches: | ||
| - main | ||
| triggers: | ||
| - timed: '0 0 * * 0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ## Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| ## or more contributor license agreements. Licensed under the Elastic License; | ||
| ## you may not use this file except in compliance with the Elastic License. | ||
|
|
||
| set -euxo pipefail | ||
|
|
||
| # | ||
| # Imports public SSH keys from Github profiles | ||
| # | ||
|
|
||
| BASEDIR=$(dirname "$0") | ||
|
|
||
| input="${BASEDIR}/../ansible/github-ssh-keys" | ||
| while IFS= read -r line | ||
| do | ||
| ssh-import-id "gh:$line" | ||
| done < "$input" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.