-
-
Couldn't load subscription status.
- Fork 90
Prepare a Runestone CodeTailor version optimized for production (initial attempt) #966
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
base: main
Are you sure you want to change the base?
Prepare a Runestone CodeTailor version optimized for production (initial attempt) #966
Conversation
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.
OK, the good news.
- It does not appear as though your changes break anything about current activecode or parsons problems
However I can't test any further.
- Please structure your changes to the overview book like a chapter so that it appears in the table of contents.
- the book server crashes when I finally figured out how to navigate my wat to the samples. It is missing the
openaiand I'm guessingjavlangmodules - You should be able to fully test this in a working docker environment. When you have done that please submit your updates.
The documentation for build and running and rebuilding containers is all on https://runestone-monorepo.readthedocs.io/en/latest/
| rsmanage = { path = "./projects/rsmanage", develop = true } | ||
| json2xml = "^3.21.0" | ||
| pytest-asyncio = "^0.24.0" | ||
| openai = "^1.59.3" |
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.
It is good to have these here, but they also need to be added to the pyproject.toml file in the book project.
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.
Thanks, are those the two places to add the new packages? Or is there more places I need to include these two new packages?
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.
Any of the servers that need those libraries need to be updated. I think it is just the book server that you are using to interface to openai.
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 also noticed that when it crashed the book server the web page spinner just kept spinning and giving me encouraging messages. You should detect a failure and give an appropriate message to the user.
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.
Yes, I only require them in the book server. I am adding it to the pyproject.toml there
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.
Okay, I will change it to an error message to the user. I am setting it as either resolve when the backend responds, or reject and send an error message if it takes longer than 1 minute.
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 also updated the PR in the overview repo to organize my content into a chapter.
|
Add a comment to keep @barbarer in the loop. |
|
I have
When you have a moment, can you take another look? Thanks! |
|
I tried it again today but no luck. You have a couple of course names hard coded that use the DEV_API key, but I was using a course that would need to use the |
|
If course.id isn’t the correct way for retrieving the course ID needed by fetch_api_key, could you clarify what the correct property or method is? Which API should I refer to for details on how to properly access or identify the course ID in this case? Or can I just put `course_id=course' here since it's already a string? |
|
First of all it is just incorrect python, a string is not a data structure that contains information about a course. https://docs.runestone.academy has a ton of information, especially on the database api for retrieving what you need. In this case it is simply the |
|
Sorry, I’m less familiar with the database api code. Thanks for pointing me to the |
|
Also, just to clarify, according to the API doc, |
|
It will be decrypted when it is returned. |
|
Got it, so just to confirm, the value returned by |
|
You do not need to confirm, just give it a try!! It is your own instance and you can always back out and change the code! |
|
Thanks! I’ve updated the code to handle course fetch by name to id, and then fetch the instructor-provided API keys using |
|
I would like to know if you have tested it? It is super inefficient for you to make code changes and ask me to test them. If you have tested them please let me know that in the updates. |
|
The primary flow has been thoroughly tested using the DEV_API key. However, I haven’t been able to fully test the fetch_api_token part because of persistent issues with the new instructor dashboard setup. I’ve arranged a meeting with Seth to address this. In the meantime, I’d really appreciate your review to check if my understanding and implementation of the instructor-provided key look correct. I’ll finish testing this part once my setup issue is resolved |
|
fetch_course does return None if a course is not found. |
|
See here for instructions on how to interactively try/test the CRUD APIs. https://docs.runestone.academy/en/latest/debugging.html#interactive-testing-with-ipython Also what kind of persistent issues with the instructor dashboard? |
|
I think the issue is not about the dashboard, but that my current db might be out of date. I am doing a fresh start on the db to see if that fixes things |
|
Ah yes, the Any time you see a file added to |
|
thanks, after setting up a new db, I’ve got the instructor dashboard and add_token feature working on my dev server. I’ll test the fetch_api_token part. |
|
Hi Brad, I spent the whole weekend trying to get the changes from Runestone components to show up in the course RST-based books, but I’m still stuck. Here is my flow right now:
However, my runestone-component changes were never reflected in the book in the course, even after complete rebuilds of both Runestone and the book. The newly deployed version never updates the Textbooks included in the course. |
|
That is a good and reliable workflow that I still use if I have to do something with RST.
|
|
Thanks, is there a way to update the runestone components for RST books inside Docker? |
|
Do you get errors with running |
|
In fact as the work flow you linked to pointed out you do not even need to use |
|
Further, make sure that when you run |
|
Yes, when running When DC_DEV_DBURL=postgresql://runestone:runestone@db/runestone_dev DEV_DBURL = postgresql://runestone:runestone@localhost:2345/runestone_dev I’m not sure what caused it, but the workflow (I described before) seems to be working today; the CodeTailor component code now appears in the course book, even though I didn’t change much. |
|
Hmm, the only thing I can think of is that the |
|
I'm glad it is working for you now. In my experience the vast majority of the time problems like you were having boil down to not having your environment variables defined. |
This PR introduces a Runestone-specific CodeTailor version (codetailor-runestone-ver) based on the latest upstream main branch.
Note:
pyproject.tomlRunestone-specific version:
book_server_apicoach.pyfetch_api_token(real service).personalize_parsonsactivecodecomponentparsonscomponent:scaffolding:to separate scaffolding puzzle code