-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Podman based local host #1240
Merged
Merged
Podman based local host #1240
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e744b4a
[remote] migrate connection to optional params
pducolin 6aa3c58
[remote] add port option to host and connection args
pducolin b2cf866
[agent] use fakeintake port in agent config
pducolin a9bb9f0
[local] add local docker host resource
pducolin 2fbdf8b
[local] add local docker host scenario and run function
pducolin d31d113
[task] add local docker host create and destroy tasks
pducolin 1f661af
move from local/docker to local/podman
pducolin 4a21fdd
more renaming from localdocker to localpodman
pducolin 61a1dcf
Merge remote-tracking branch 'origin/main' into pducolin/docker-local…
pducolin a4b0205
[resources][local] remove common environment accessor
pducolin 7215a14
[scenarios][local] improve podman vm description
pducolin 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 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 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 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 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 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,60 @@ | ||
package remote | ||
|
||
import ( | ||
"github.com/DataDog/test-infra-definitions/common" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
type connectionArgs struct { | ||
host pulumi.StringInput | ||
user string | ||
|
||
// ==== Optional ==== | ||
privateKeyPath string | ||
privateKeyPassword string | ||
sshAgentPath string | ||
port int | ||
} | ||
|
||
type ConnectionOption = func(*connectionArgs) error | ||
|
||
func buildConnectionArgs(host pulumi.StringInput, user string, options ...ConnectionOption) (*connectionArgs, error) { | ||
args := &connectionArgs{ | ||
host: host, | ||
user: user, | ||
port: 22, | ||
} | ||
return common.ApplyOption(args, options) | ||
} | ||
|
||
// WithPrivateKeyPath [optional] sets the path to the private key to use for the connection | ||
func WithPrivateKeyPath(path string) ConnectionOption { | ||
return func(args *connectionArgs) error { | ||
args.privateKeyPath = path | ||
return nil | ||
} | ||
} | ||
|
||
// WithPrivateKeyPassword [optional] sets the password to use in case the private key is encrypted | ||
func WithPrivateKeyPassword(password string) ConnectionOption { | ||
return func(args *connectionArgs) error { | ||
args.privateKeyPassword = password | ||
return nil | ||
} | ||
} | ||
|
||
// WithSSHAgentPath [optional] sets the path to the SSH Agent socket. Default to environment variable SSH_AUTH_SOCK if present. | ||
func WithSSHAgentPath(path string) ConnectionOption { | ||
return func(args *connectionArgs) error { | ||
args.sshAgentPath = path | ||
return nil | ||
} | ||
} | ||
|
||
// WithPort [optional] sets the port to use for the connection. Default to 22. | ||
func WithPort(port int) ConnectionOption { | ||
return func(args *connectionArgs) error { | ||
args.port = port | ||
return nil | ||
} | ||
} |
This file contains 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 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 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 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,26 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN set -eu && \ | ||
apt update; \ | ||
apt install -y \ | ||
--no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
systemd \ | ||
systemd-cron \ | ||
sudo \ | ||
openssh-server; | ||
|
||
# setup ssh | ||
RUN mkdir -p /etc/ssh/sshd_config.d && echo "PermitRootLogin without-password" > /etc/ssh/sshd_config.d/allow_root.conf | ||
ARG DOCKER_HOST_SSH_PUBLIC_KEY | ||
RUN mkdir -p /root/.ssh && echo $DOCKER_HOST_SSH_PUBLIC_KEY >> /root/.ssh/authorized_keys | ||
RUN chmod 600 /root/.ssh/authorized_keys | ||
|
||
RUN service ssh start | ||
|
||
EXPOSE 22 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This docker file is meant only for local development |
||
|
||
CMD ["/usr/sbin/init"] |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will change the behavior because currently we always use port
80
. We might end up with the config using port443
when the fakeintake is deployed in ECS. Are we sure it still works as expected?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, testing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, this does not work with ecs. Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no,
agentparams
is used only on hostsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this made me realise that
inv aws.create-ecs
does not work without LB, because we assumehttps
endpoints on ecs agent params https://github.com/DataDog/test-infra-definitions/blob/pducolin/docker-localhost/components/datadog/agent/ecs.go#L257There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the same time we don't support LB on hosts, because we always assume
http
protocol. Creating a card to track thoseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://datadoghq.atlassian.net/browse/ADXT-769