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

Feature/Add minimal k8s scheduler #105

Closed
wants to merge 0 commits into from

Conversation

Mtze
Copy link
Member

@Mtze Mtze commented May 28, 2024

Open Problems

  • Inject Job / Step Metadata in containers
  • "Access Denied" Error for buildscript
  • Test with a real build job example

@Mtze Mtze requested a review from robertjndw May 31, 2024 14:56
@Mtze Mtze marked this pull request as ready for review May 31, 2024 14:56
HadesScheduler/go.mod Outdated Show resolved Hide resolved
go.work Outdated Show resolved Hide resolved
Comment on lines 18 to 34
type K8sConfig struct {
// K8sNamespace is the namespace in which the jobs should be scheduled (default: hades-executor)
// This may change in the future to allow for multiple namespaces
K8sNamespace string `env:"K8S_NAMESPACE,notEmpty" envDefault:"hades-executor"`

// K8sConfigMode is used to determine how the Kubernetes client should be configured ("kubeconfig" or "serviceaccount")
ConfigMode string `env:"K8S_CONFIG_MODE,notEmpty" envDefault:"kubeconfig"`
}

// K8sConfigKubeconfig is used as configuration if used with a kubeconfig file
type K8sConfigKubeconfig struct {
kubeconfig string `env:"KUBECONFIG"`
}

// K8sConfigServiceaccount is used as configuration if used with a service account
type K8sConfigServiceaccount struct {
}
Copy link
Member

@robertjndw robertjndw Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer to have nested structs in this case. I mean in theory we can check for all env variables and try to load them. Depending on the ConfigMode we then select one of the nested structs

job: job,
k8sClient: k.k8sClient,
namespace: k.namespace,
sharedVolumeName: "shared",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have side-effects on parallel builds if we name all the shared volumes the same?

HadesScheduler/k8s/job_unittest.go Outdated Show resolved Hide resolved
HadesScheduler/k8s/job.go Outdated Show resolved Hide resolved
@Mtze Mtze closed this Aug 13, 2024
@Mtze Mtze force-pushed the feature/add-minimal-k8s-scheduler branch from 7700dad to ec53594 Compare August 13, 2024 11:20
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