Git Product home page Git Product logo

ngshare's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngshare's Issues

Installing issues

Hello,
We are trying to install ngshare, but helm install ngshare helmchart/ngshare returns an error that helm install can only accept one argument.

Also, after changing the directory to helmchart and running helm install ngshare we get this error:

Error: parse error in "ngshare/templates/_helpers.tpl": template: ngshare/templates/_helpers.tpl:58: function "get" not defined

Feedback API questions

What happens when an instructor upload feedbacks for a same submission? Should the files be overwritten?

Merging ngshare and vngshare

@rkevin-arch I think you proposed this a long time ago and I rejected. Now I changed my mind and think we should make vngshare available by python3 ngshare.py --vngshare ....

My reasoning is that users cannot easily start vngshare from a installed pip package. If we do not merge then they may need to do:
python3 -c 'import ngshare; ngshare.vngshare.main()' --host 127.0.0.2

api-specifications.md Error Codes

Hello Team KALE,
For your api-specifications documentation, would you be able to add to your documentation the HTTP status codes that your various responses generate? Having these status codes properly implemented and documented would allow for better error handling.

Example:

Status Code Status Message
200 Okay
401 Login required
403 Permission denied
404 Course not found
404 Instructor not found

Thanks,
-Henry Agnew
LibreTexts Lead Full-Stack Developer
UC Davis, class of 2020

Assignment state

Should an assignment have some states? And the server can block submission when assignment is in an incorrect state? For example:

  • not_released
  • released
  • deadline_passed
  • feedback_uploaded

When to release a new version

I'm not entirely sure if I should release a new version after PR #120. Releasing versions too frequently is kinda bad since users will have to keep updating, but also that feature is useful for at least a couple of people so we should probably make it available sooner rather than later. @lxylxy123456 What do you think?

Time format

@Lawrence37 Could you please specify a datetime format in the API spec? For example:
%Y-%m-%d %H:%M:%S %Z%z

Note: maybe this should not be used because it doesn't include information up to nanosecond

Taking this to the next level

Great work so far. You have a cool project here.

I would recommend trying a few things to improve code maintainability down the road:

  • set up a CI system for testing (CircleCI, Azure Pipelines, whatever)
  • set up a code coverage tool for automated reporting
  • add some documentation deployed on ReadTheDocs
  • add badges for the above into the top of the main README
  • consider adding the black project for python code consistency

Well done. cc/ @moorepants

Listing submissions API

https://github.com/lxylxy123456/ngshare/blob/master/api-specifications.md#request-3

@Lawrence37 Do we need to include all the file lists? ("notebooks":[...])

  1. I think the assignment directory tree should be the same as submission directory tree (only files are different)
  2. The file list will also be available if the instructor downloads it at /api/submission/<course_id>/<assignment_id>/<student_id>. If needed, we can add an option of listing the filenames without downloading them.

Installing ngshare on UCD JupyterHub

Could I please confirm if this is the correct default config.yaml?

  2   resources:
  3     limits:
  4       cpu: 100m
  5       memory: 128Mi
  6
  7 ngshare:
  8   # You may omit this, but the token will be randomly generated.
  9   # It's recommended to specify an API token here.
 10   hub_api_token: <secret string>
 11   admins: [myusername]
 12
 13 pvc:
 14   # Amount of storage for ngshare
 15   storage: 1Gi

I tried installing this to a separate namespace called ngshare and it keeps spiraling into a crash loop.

$ kubectl logs doltish-quoll-ngshare-8d78dd89b-c97ww -n ngshare
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/dist-packages/ngshare/__main__.py", line 3, in <module>
    main()
TypeError: main() missing 1 required positional argument: 'argv'

Codecov migration to marketplace app

Hi, Tom from Codecov here.

We noticed that you are using Codecov with fairly high frequency, and we’re so excited to see that! However, because you are not using our app, you may have experienced issues with uploading reports or viewing coverage information. This is due to rate-limiting issues from GitHub.

In order to prevent any future outages, we ask that you move over to our GitHub app integration.

The process is extremely simple and shouldn’t require more than a few clicks, and you should not expect any downtime. By moving to our app, you will no longer need an admin or separate account to manage the relationship with GitHub as the team bot.

Let me know if you have any questions, or if I can help at all with this process.

Uninstalling ngshare

Have you tried uninstalling ngshare, and are there instructions for it? Is it as simple as helm delete ngshare --purge?
One thing I noticed was that ngshare is installed under the kube-system namespace. I don't know whether makes it difficult to uninstall. Might want to consider adding instructions with deploying ngshare on a different namespace like JupyterHub does, but this is up to you guys.

Polish the documentation

While reviewing the documentation, I made some changes which you will see in a pull request. There are some additional things that we may want to address.

  • Building the HTML documentation results in this warning: html_static_path entry '_static' does not exist.
  • Add all dependency installation instructions for rendering the tikz figure in the documentation. I get LaTeX error: "File 'standalone.cls' not found."
  • Consistent capitalization for section titles. Ex: "Extra features" vs. "Extra Features"
  • Prominently display a link to this repository in the contributor guide.
  • Add developer installation instructions to the contributor guide.
  • Debate placement of the "Install vngshare" section. I think it should go under the contributor guide.
  • Consider removing the top level of the APIs hierarchy. In other words, make "API Definitions", "Authentication", etc. direct children of "APIS" rather than under "APIS" -> "APIs".
  • Discuss whether or not "Removing" should be in the API definitions.
  • Consider adding some formatting to "HTTP ### <reason>" texts in the "Request and Response Format" section.
  • Talk about the 500 status code in the user documentation. Currently, it is only in the "Request and Response Format" section and it says to submit a bug report. A user may not see this message if it's not in the user documentation.
  • Reword "Submissions of the instructor are not removed" in the course APIs section. It is not 100% clear what the sentence is saying.
  • Debate the inclusion of the "Development History" section. It doesn't seem relevant to users and future developers.
  • Add our justifications for using certain technologies in the "Decisions" section.
  • Add more details to the "Development" section. For example, explain what the code does.
  • Add introduction in the user documentation explaining what nghsare is. I missed the home page. I will review that.
  • Explain that a plugin is needed for ngshare to work with nbgrader. This will probably be resolved when the "Install nghsare" section has been written, but I'm putting this here as a reminder.
  • Explain what "JupyterHub authentication" is in the "Authentication" page.

Using None instead of empty string

I was wondering whether it would be better to use None instead of empty strings for the optional fields in ngshare. Currently nbgrader allows for the first name, last name and email of a student to be None.
Screen Shot 2020-03-28 at 8 35 02 PM
but ngshare only allows for empty strings, not for None.
Screen Shot 2020-03-28 at 8 37 10 PM
Screen Shot 2020-03-28 at 8 38 18 PM

Not a big deal but wanted to see your thoughts.

Permission issue

This problem happens after #18
Consider the API /api/assignments/<course_id>.
If we have one class ECS123, and a student not taking this class
Then for this user, /api/assignments/ECS123 returns "permission denied", and /api/assignments/ECS124 returns "course not found"

So any user who can access the service can list all courses using brute force.
Is this a problem?

Bug when creating a new student

When you create a new student the line student = self.find_user(student_id) looks for the student. When creating a student for the first time you get the error User not found.

Remove random string from API

The random string in nbgrader is used only to prevent students from accessing other students' submissions. The random string only appears in the inbound directory of the exchange. It is not used in the user's cache, so it does not serve as a unique submission identifier, at least for cached submissions. ngshare should be able to prevent unauthorized access by design, so the random string is not needed for ngshare.

This issue is for tracking the removal of random string. @aalmanza1998 and I will revise the API specifications first. @lxylxy123456 will ensure vserver and ngshare follow the new API.

PostgreSQL support

Hi!

I was just testing out whether I could have ngshare run on the same PostgreSQL server as I have JupyterHub on. I'll document my issues here.

  • The Docker image needs psycopg2. I used a custom image:
    FROM libretexts/ngshare:v0.5.1
    USER 0:0
    RUN pip install psycopg2-binary
    USER 65535:65535
  • The database seems to be designed with Sqlite's dynamic-ish typing. Best case, ngshare should be tested against both sqlite and PostgreSQL. Example error, although I would expect many more due to Sqlite's lax behaviour wrt types:
    sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DatatypeMismatch) foreign key constraint "assignment_files_assoc_table_left_id_fkey" cannot be implemented
    DETAIL:  Key columns "left_id" and "_id" are of incompatible types: text and integer.
    
    [SQL:
    CREATE TABLE assignment_files_assoc_table (
    	left_id TEXT NOT NULL,
    	right_id INTEGER NOT NULL,
    	PRIMARY KEY (left_id, right_id),
    	FOREIGN KEY(left_id) REFERENCES assignments (_id),
    	FOREIGN KEY(right_id) REFERENCES files (_id)
    )
    
    ]
    
  • Sqlite creates the database automatically when opened, but psycopg2 as driver does not. I used a Kubernetes Job to create the database instead. This might need a simple code change somewhere.
  • Unless I am mistaken, the PVC that gets allocated is only used for the Sqlite support, so that should be shut of when the installations opts for PostgreSQL.

Is PostgreSQL support something you folks would be interested in? I'd provide some patches if so.

Remove vserver to its own repo

If vserver is no longer used in any capacity to support the current code, it probably makes sense to move it to its own repo to avoid confusing users of ngshare.

Nice work folks!

Update README.md

The README for ngshare is very short. We need to add more information to it so that users and potential users understand what ngshare does.

This is a (noncomprehensive) to-do list. Please add items here by editing this post.

  • What is ngshare?
  • What can I use it for?
  • Installation and setup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.