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

async container launch kubernetes "process" #9242

Merged

Conversation

jrhizor
Copy link
Contributor

@jrhizor jrhizor commented Jan 1, 2022

  • abstracts away the launcher workers with LauncherWorker
  • introduces AsyncOrchestratorPodProcess to "monitor" a pod that's running, so if it's re-run with the same attempt it continues with the same existing pod without killing it.

This change is Reviewable

@github-actions github-actions bot added area/platform issues related to the platform area/worker Related to worker labels Jan 1, 2022
.env Outdated
@@ -98,3 +98,5 @@ STATE_STORAGE_GCS_BUCKET_NAME=

# Sentry
SENTRY_DSN="https://[email protected]/6102835"

CONTAINER_ORCHESTRATOR_ENABLED=true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove this before merging

@jrhizor jrhizor temporarily deployed to more-secrets January 1, 2022 01:45 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 1, 2022 01:47 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 3, 2022 17:33 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 6, 2022 15:56 Inactive
@jrhizor
Copy link
Contributor Author

jrhizor commented Jan 6, 2022

@davinchia @benmoriceau would like some first looks over the AsyncOrchestratorPodProcess and *LauncherWorker classes.

Still have some cleanup to do, just want general feedback on the approach.

} else if (secondDocStoreStatus.equals(AsyncKubePodStatus.SUCCEEDED)) {
return 0;
} else {
// otherwise, the actual pod is terminal when the doc store says it shouldn't be.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we update the doc store as failed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's important for the contract to be that only the container orchestrator itself writes to the store and that we handle that state + the kube cluster state instead of trusting other pieces to write to the store as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree. can we document this expectation in the container orchestrator and the state manager doc strings so it's obvious to devs?

}

@Override
public void destroy() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we delete the doc store here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's no downside to maintaining a history on cloud storage? Maybe we'll need to add this to job sweeping eventually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree we can create an issue to remind ourselves and punt this till later.

@davinchia
Copy link
Contributor

davinchia commented Jan 7, 2022

I think I generally follow. The pattern to poll on the api and update the state bucket seems reasonable!

I think my main concern is that there seems to be too many places where state can change e.g. the OrchestratorApp writing state. This can get complicated quickly. I think we should try to either keep all state writes/reads in a class or a clear set of abstractions or set a standard around state management e.g. state management cannot happen more than 1 abstraction layer away from the async process. This would also make things easier to test.

I'm worried because process state has been biting us a lot. Introducing a remote cache is great and can also make this more complex.

I'm not commenting on specific stuff since you said this is still WIP. Appreciate the early review request!

(Sorry I know it's quite hand wavy of me to say this. I haven't put much thought into an alternative approach yet. I'm happy to spend some time next week if needed)

@jrhizor jrhizor temporarily deployed to more-secrets January 10, 2022 07:35 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 10, 2022 17:51 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 10, 2022 18:29 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 10, 2022 23:00 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 11, 2022 07:07 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 12, 2022 21:49 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 12, 2022 22:18 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 13, 2022 15:18 Inactive
@jrhizor jrhizor requested a review from benmoriceau January 13, 2022 15:21
@jrhizor jrhizor marked this pull request as ready for review January 13, 2022 15:21
@jrhizor jrhizor temporarily deployed to more-secrets January 13, 2022 15:23 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 13, 2022 15:26 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 13, 2022 15:31 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 13, 2022 15:45 Inactive
Copy link
Contributor

@davinchia davinchia left a comment

Choose a reason for hiding this comment

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

Looks great! Much much cleaner, especially the state management, which is mostly contained in 1/2 classes now.

Some questions for clarity. Can I confirm, the orchestrator stuff won't be available for docker yeah?

Feel free to merge once you have dealt with the comments.

@@ -184,6 +184,32 @@ spec:
configMapKeyRef:
name: airbyte-env
key: JOB_KUBE_MAIN_CONTAINER_IMAGE_PULL_POLICY
# todo: add other state storage keys
- name: STATE_STORAGE_MINIO_BUCKET_NAME
Copy link
Contributor

Choose a reason for hiding this comment

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

we can add in a follow up PR - should also update the https://docs.airbyte.com/operator-guides/configuring-airbyte#kubernetes-only with the state env vars.

@jrhizor jrhizor temporarily deployed to more-secrets January 20, 2022 15:53 Inactive
@jrhizor jrhizor merged commit db40932 into master Jan 20, 2022
@jrhizor jrhizor deleted the jrhizor/async-kube-pod-process-with-reattach-via-cloud-storage branch January 20, 2022 15:56
@jrhizor jrhizor temporarily deployed to more-secrets January 20, 2022 15:56 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/worker Related to worker kubernetes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants