Skip to content
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

Merged
merged 7 commits into from
Oct 25, 2024
Merged

Update mothership endpoint #82

merged 7 commits into from
Oct 25, 2024

Conversation

cardyok
Copy link
Contributor

@cardyok cardyok commented Sep 27, 2024

No description provided.

components/info/component.go Outdated Show resolved Hide resolved
cmd/gpud/command/command.go Outdated Show resolved Hide resolved
cmd/gpud/command/command.go Outdated Show resolved Hide resolved
cmd/gpud/command/join.go Outdated Show resolved Hide resolved
Comment on lines +100 to +232
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()
Copy link
Contributor

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 :)

@cardyok cardyok force-pushed the update-mothership-endpoint branch 7 times, most recently from a95fa54 to 4e5040d Compare October 15, 2024 19:23
@cardyok cardyok marked this pull request as ready for review October 15, 2024 19:23
@cardyok cardyok force-pushed the update-mothership-endpoint branch 5 times, most recently from 94680fc to deec7b8 Compare October 16, 2024 18:31
@gyuho gyuho added this to the v0.0.6 milestone Oct 17, 2024
@cardyok cardyok force-pushed the update-mothership-endpoint branch 8 times, most recently from 25c8651 to 34e52db Compare October 21, 2024 02:15
@cardyok cardyok force-pushed the update-mothership-endpoint branch 3 times, most recently from b1906f1 to a5821cd Compare October 21, 2024 02:48
cmd/gpud/command/command.go Outdated Show resolved Hide resolved
// network section
publicIP, _ := login.PublicIP()
region := "unknown"
detectProvider := ""
Copy link
Contributor

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:

latencies = append(latencies, latency.Latency{
Provider: ProviderTailscaleDERP,

(this has nothing to do with node setup or GPUs)

@cardyok cardyok force-pushed the update-mothership-endpoint branch 2 times, most recently from d06bf1c to 069b60e Compare October 23, 2024 09:43
@cardyok cardyok force-pushed the update-mothership-endpoint branch 6 times, most recently from b4486f7 to 0ca91af Compare October 25, 2024 05:15
Signed-off-by: cardyok <[email protected]>
@cardyok cardyok merged commit e134fee into main Oct 25, 2024
5 checks passed
@gyuho gyuho deleted the update-mothership-endpoint branch October 27, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants