Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Preliminary Seqexec Support #282

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

swalker2m
Copy link
Contributor

This PR is intended to open a conversation about what is needed to provide the seqexec with access to the new program model. Initially we need to be able to fetch observations from the ODB and then load them from the database.

I added a simple Service.queryObservationById(id: Observation.Id) method to complement ocs2.importObservation(host: String, oid: Observation.Id). In theory the seqexec can create a session by logging in and then use these two methods to obtain an observation containing a sequence.

I assume the observation you get back won't align exactly with what the seqexec needs but that's the next step. Also we'll eventually want the seqexec to write datasets and events back to the database and we'll need to provide the API for that as well.

@cquiroz
Copy link
Contributor

cquiroz commented Jun 4, 2018

How would you login?

@tpolecat
Copy link
Member

tpolecat commented Jun 4, 2018

How would you login?

gem needs to manage external users so it has its own user/role tables.

  • An easy initial solution is to have a seqexec account that the seqexec uses, and provide the password to the seqexec on startup. I think this makes sense for the initial deployment.
  • A better but harder solution is to federate with LDAP for authenticating gemini users and pass the operator's identity all the way through, and have all services use the exact same code to do this. We need this anyway but maybe not initially.

This assumes the seqexec talks to gem through some kind of network protocol. If it talks directly to the database then the game is different I think.

// case GET -> Root / "api" / "fetch" / "obs" / o as gs =>
// withObsId(o) { oid =>
// gs.queryObservationById(oid).flatMap { obs =>
// Ok(obs.asJson)
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 I'll wait and see what comes out of @tpolecat 's next PR before trying to fix this, but does this seem like it is in the direction of what we want?

> compile
[info] Compiling 1 Scala source to /Users/swalker/dev/gem/modules/web/target/scala-2.12/classes ...
[error] /Users/swalker/dev/gem/modules/web/src/main/scala/Application.scala:55:20: could not find implicit value for parameter encoder: io.circe.Encoder[gem.Observation.Full.Aux[I]]
[error]             Ok(obs.asJson)

Copy link
Member

Choose a reason for hiding this comment

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

Yep something like that looks good. That type is just Observation in my WIP so it will be straightforward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants