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
Create a more prototyping-friendly development experience #257
Comments
Sorry for the late reply. I had to think a bit about it. I understand that in the way you are using JATOS it appears as not user-friendly. The reason is JATOS wasn't build to be used in the way you described: builder generates a jzip -> import -> test -> repeat until done. The development cycle we had in mind was more like: create a new study or import one from the example studies -> edit files in the study assets folder directly -> test -> repeat until done. There is no import necessary (except the initial if one starts with an existing study jzip). But I see the point of using a builder like jspsych-builder (or lab.js or OSWeb). They make it much easier to create the actual experiment - something that JATOS does not help you with. Now I'm thinking of a way to make it easier for those builders to interface with JATOS, so one does not have to import the study repeatedly. So far I came up with two ideas that I want to sketch here:
So far my thoughts. This builder-JATOS interfacing has to be well-thought through. Do you think they could work out? Which one would you prefer? Maybe there is another variant I haven't thought about? Thinking of the users: are they easy enough to use? How was lunch today? I'd like to start a discussion here. |
Disclaimer: I've never used Re: point 1
Something like this seems ideal, at first glance.
e.g., in my typical workflow, I don't actually care that the data is saved, just that I can interact with JATOS in all the expected ways. (e.g., I can retrieve i.e., I don't need the assets folder/whatever else because I have a local development server running on my computer.
Given it's a PAT, I think the default mode should be either an environment variable or storage in something like Re: point 2 So, re:VCS β I like the idea of auto-deploys from such a system β but what you described sounds like the same process I've been frustrated with in a different form. π I'm generally agreed on the idea that interfacing should be well thought out. I'm not sure about I think an ideal (though potentially [unnecessarily] complex) route would something that allows for an API much like JSPsych does in ES modules (e.g., consider the following). // This could short-circuit and essentially search for an existing global
// jatos variable (or something like `process.env.MODE == "production"`
const jatosJS = initJATOS({
token: `<your-PAT>`, // honestly this should be grabbed from `process.env.JATOS_TOKEN` or similar
url: `<jatos-installation-url>`,
...options
}) I believe an interface like this would actually allow JATOS to be used by Maybe this begs another question of β are the JATOS API and GUI fully disentangled? If so, is the JATOS API something that is/could be fully accessible through JavaScript? (It seems that your preferred language is Scala, so I'm not sure where Scala begins/ends for JATOS. π ) If the API and GUI are fully disentangled, then I'm pretty sure that I'd be comfortable defining studies in JavaScript. Given early days and the most alpha-like state this would be in, I think treating JATOS in a development and production environment as drastically different is probably okay? Sorry for the longwinded thoughts. I'm not exactly sure how to approach this, but I guess, succinctly, I'd like to be able to either define a study in JATOS that is a test-study that allows me to interact with JATOS as I would in production (though advancing to other components is irrelevant to me, I think), or fully-defining a study in JavaScript. In either case, having something like a Docker container that could be spun-up to act as the appropriate endpoint seems like a good solution β since I think the folks opting for local development using tools like (I definitely understand that your ideal modus operandi of JATOS being "anyone could do this", but I'm not sure if "anyone" would actually need this development capacity β since this seems to be something that would mostly "plague" folks developing experiments outside of the intended JATOS way.) |
Re 1: That's a great idea! jsPsych-builder-wise, this would enable something like a @jmuchovej I think that's all I'd like to support in jspsych-builder then: It's helpful for development and production. For most users, I guess, development work concentrates on the actual jsPsych experiment, not so much the JATOS integration. Hence, I woudn't like to bake a special JATOS mode into the Re 2:
Right, although I personally wouldn't like to check my (possibly non-final) build outputs into source control just to get them into JATOS. But for folks versioning their JATOS study assets with git, this would be perfect! I love the idea of improving/documenting the API and adding auth token support. This could be used to approach your second point too by providing some script to update remote studies according to local files (reading the JATOS API URL and auth token from env variabels). Without tightly coupling JATOS with the platforms themselves then, you could provide examples of invoking the script "on push" for all kinds of CI providers (GH Actions, GitLab CI, Bitbucket Pipes, ...), or even publish a "deploy-to-jatos" GitHub action that brings the script and runs it. One solution to rule them all and make builders happy π₯³
The API itself certainly not. But the "Use Git, GitHub or GitLab" approach β which could boil down to throwing a CI config and two secrets at GitHub/GitLab/Bitbucket β for sure!
Great, thanks! π Some promising resources regarding API docs: |
Sounds like improving the JATOS API and adding auth tokens is the way to go. I like this approach π. And I agree with @bjoluc, a tight coupling with GitHub is probably not necessary - one can do this with a script or GitHub Actions or something similar. And thanks @bjoluc for the link to docusaurus-openapi, I didn't know about this one yet. We use Docusaurus already for the JATOS docs, so this should be the obvious tool to use. And @jmuchovej about your question: "are the JATOS API and GUI fully disentangled?". It is an API with many HTTP endpoints (inspired by REST but not fully REST). So, yes it's fully disentangled, in the meaning that you can use it from wherever you want, JS running in browser or server-side, Python, Java (any other language) or tools like Postman. Only the backend is written in Java and Scala. So my plan is to start working on the JATOS API improvements after the 3.7.4 release (which should come out in a week or two). But I can't yet say how long this will take. The token stuff is new to me and since this is about authentication we have to do this thoroughly. And then API documentation. And I even think about if we have to change / add some endpoints to be usable outside the GUI. I guess the time frame for this whole improvement is 6 to 12 weeks. Sorry, can't be more precise. But it would be nice if you could be testers and give feedback as soon as there is something like an API with auth tokens. JATOS has a Slack and this would be a better place for discussions. What do you think? |
@kristian-lange-tw Sounds great! Happy to test things out and draft an integration in jspsych-builder. I didn't find a public Slack invite link, so feel free to invite me via |
oh, i just found this thread, and i'd like to propose an alternative. here's my proof of concept: jonathon |
If it's any help, here's my pipeline which is pretty painless: JATOS in a docker container
deploy script (in package.json)
After making changes, I simply run |
π I've been rather frustrated with the import/delete cycle I've needed to go through while prototyping studies β especially when this loop is caused by needing to check that JATOS functionality is working as intended.
I understand why this might not be a priority to develop, but I'm willing to contribute to this, if needed.
Essentially, as I'm developing experiments with @bjoluc/jspsych-builder, to test out JATOS-specific functionality, like data storage/upload, I usually find myself in a cycle of build -> import -> test -> delete if buggy.
It would be nice to circumvent this most of the process during development, but I can understand why that might be undesirable from a reproducibility standpoint.
I can imagine a few solutions to this, but I'm not sure which makes the most sense both in terms of JATOS' goal(s) and development time/effort. I'm also not sure of the design schema of JATOS at the moment, which I imagine could constrain the ways towards this.
vN.M
.The text was updated successfully, but these errors were encountered: