-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update mothership endpoint #82
Conversation
func handleJoinResponse(ctx context.Context, body io.Reader) error { | ||
dir, err := untarFiles("/tmp/", body) | ||
if err != nil { | ||
return err | ||
} | ||
scriptPath := filepath.Join(dir, "join.sh") | ||
return runCommand(ctx, scriptPath, nil) | ||
} | ||
|
||
func untarFiles(targetDir string, body io.Reader) (string, error) { | ||
var dir string | ||
gzipReader, err := gzip.NewReader(body) | ||
if err != nil { | ||
return "", fmt.Errorf("failed to create gzip reader: %w", err) | ||
} | ||
defer gzipReader.Close() | ||
|
||
tarReader := tar.NewReader(gzipReader) | ||
|
||
for { | ||
header, err := tarReader.Next() |
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.
need a separate function in a separate package, but for now, we can keep everything here :)
a95fa54
to
4e5040d
Compare
94680fc
to
deec7b8
Compare
25c8651
to
34e52db
Compare
b1906f1
to
a5821cd
Compare
cmd/gpud/command/join.go
Outdated
// network section | ||
publicIP, _ := login.PublicIP() | ||
region := "unknown" | ||
detectProvider := "" |
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.
Remove this? Currently hard-coded to tailscale only since we only talk to tailscale public DERP servers:
Lines 73 to 74 in 871533e
latencies = append(latencies, latency.Latency{ | |
Provider: ProviderTailscaleDERP, |
(this has nothing to do with node setup or GPUs)
d06bf1c
to
069b60e
Compare
Signed-off-by: cardyok <[email protected]>
Signed-off-by: cardyok <[email protected]>
Signed-off-by: cardyok <[email protected]>
Signed-off-by: cardyok <[email protected]>
Signed-off-by: cardyok <[email protected]>
Signed-off-by: cardyok <[email protected]>
b4486f7
to
0ca91af
Compare
Signed-off-by: cardyok <[email protected]>
0ca91af
to
ecb7d9b
Compare
No description provided.