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

Add task implementations for by-passing the java delegate #136

Merged
merged 13 commits into from
Jul 13, 2022

Conversation

vistaarjuneja
Copy link
Collaborator

@vistaarjuneja vistaarjuneja commented Jul 6, 2022

This PR adds support to directly start accepting and executing Harness tasks.
It uses wings-software/dlite as a library to poll for tasks and only contains implementations of the initialize, execute and destroy tasks.
It contains the mapping of the task types to the handlers which receive the task as input and should write the response back after execution.

@vistaarjuneja vistaarjuneja requested a review from shubham149 July 11, 2022 12:51
command/harness/dlite/init.go Outdated Show resolved Hide resolved
command/harness/dlite/init.go Show resolved Hide resolved
command/harness/dlite/init.go Show resolved Hide resolved
command/harness/dlite/execute.go Show resolved Hide resolved
func (c *dliteCommand) startPoller(ctx context.Context, tags []string) error {
r := router.NewRouter(routeMap(c))
// TODO (Vistaar): Set a token updater thread which resets the token
token, err := delegate.Token("audience", "issuer", c.env.Dlite.AccountID, c.env.Dlite.AccountSecret, tokenExpiry)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when token expires now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have set it to 10 hours for now - after that dlite will not be able to talk to manager. There is an open ticket to fix that: https://harness.atlassian.net/browse/CI-4946. I will see how java delegate does it, if they set infinite expiry will do the same.

StringVar(&c.poolFile)
}

func (c *dliteCommand) startPoller(ctx context.Context, tags []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also delete the pools in case we receive sigterm call if reuse pool is not set. Can be taken up in next PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ack. Will create a ticket for it

command/harness/dlite/cleanup.go Show resolved Hide resolved
command/harness/delegate/delegate.go Show resolved Hide resolved
command/config/config.go Outdated Show resolved Hide resolved
command/harness/delegate/delegate.go Outdated Show resolved Hide resolved
command/harness/delegate/delegate.go Outdated Show resolved Hide resolved
command/harness/delegate/delegate.go Show resolved Hide resolved
command/harness/delegate/delegate.go Show resolved Hide resolved
command/harness/dlite/cleanup.go Outdated Show resolved Hide resolved
@vistaarjuneja vistaarjuneja merged commit 140527d into master Jul 13, 2022
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