-
Notifications
You must be signed in to change notification settings - Fork 1
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
Draft: submit dummy Slurm job #239
base: develop
Are you sure you want to change the base?
Conversation
const [searchLoading, setSearchLoading] = useState<boolean>(false); | ||
const [queryType, setQueryType] = useState<'slurm' | 'osmp'>('osmp'); | ||
|
||
const [id, setId] = useState<string>(''); |
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.
I still need a way to somehow pass the jobId
from Slurm to the front-end. Any ideas?
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.
Didn't you make it part of OnSlurmResponse
?
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.
Yeah, so the way this works is a little bit different.
When the page loads for the first time, useFetchVariantsSubscription
will execute a subscription and starts listening for data from the server. If the server publishes data for the first time, useFetchVariantsSubscription
will receive it. However, if the server publishes data for the second time, useFetchVariantsSubscription
will actually still use the old data. The way Apollo subscription hook will "resubscribe" is when we pass in a different value in variables
. That's why I'm passing a random number to the variables to trigger re-subscription. But ideally, we'd want to know the jobId
in advance, which I haven't figured out how to do yet.
Note that it is strongly recommended to switch from |
The goals of this PR are:
echo Hello world!
). Result can be seen on the working directory in the Slurm node.[PubSub class](https://www.apollographql.com/docs/apollo-server/data/subscriptions/#the-pubsub-class)
is created to subscribe and publish results to the front end. See documentation here on how Subscriptions are created in GraphQL Apollo.Job Automation Flow
Before diving into the code, it is helpful to understand the high-level flow of this implementation.
getVariantResolver
. If the gene size is >600,000bp, we submit a job request through the Slurm API. Currently, we are running a dummy job. The API does not actually kick-start the Nextflow job, though this will be integrated down the line.http://localhost:9821/auth/realms/ssmp/protocol/openid-connect/token
(for local development), orhttps://keycloak.ccmdev.ca/auth/realms/ssmp/protocol/openid-connect/token
in staging./graphql
is responsible for handling all inbound requests. A subscription class is created to receive the data and publish it to the front end.VariantQueryPage
will display the result from thequery
or the result from thesubscription
. In the case of a subscription, the result returned by the query is an empty list, and the front end displays data that is pushed from the web socket server.