Skip to content

Instantly share code, notes, and snippets.

@yuvipanda
yuvipanda / hello.c
Last active November 14, 2018 22:46
helloworld.c
#include <stdio.h>
int main() {
printf("Hello world!");
return 0;
}
@yuvipanda
yuvipanda / Today's Logs
Created November 7, 2018 18:59
debugging logs for hub
This file has been truncated, but you can view the full file.
Loading /etc/jupyterhub/config/values.yaml
Loading /etc/jupyterhub/secret/values.yaml
[I 2018-11-07 03:12:27.089 JupyterHub app:1673] Using Authenticator: oauthenticator.google.GoogleOAuthenticator-0.8.0
[I 2018-11-07 03:12:27.089 JupyterHub app:1673] Using Spawner: builtins.CustomKubeSpawner
[I 2018-11-07 03:12:27.104 JupyterHub app:1016] Loading cookie_secret from /srv/jupyterhub/jupyterhub_cookie_secret
[W 2018-11-07 03:12:27.452 JupyterHub app:1131] JupyterHub.hub_connect_port is deprecated as of 0.9. Use JupyterHub.hub_connect_url to fully specify the URL for connecting to the Hub.
[I 2018-11-07 03:12:27.616 JupyterHub app:1201] Not using whitelist. Any authenticated user will be allowed.
[I 2018-11-07 03:12:29.980 JupyterHub reflector:199] watching for pods with label selector='component=singleuser-server' in namespace prod
[I 2018-11-07 03:12:32.953 JupyterHub reflector:199] watching for events with field selector='involvedObject.kind=Pod' in namespace prod
[I 2018-11-07 03:12:37.166 JupyterHub app:145

Looking at Logs

Logs are extremely useful in piecing together what went wrong when things go wrong. They contain a forensic record of what individual pieces of software were doing before things went bad, and can help us understand the problem so we can fix it.

TLJH collects logs from JupyterHub, Configurable HTTP Proxy & from each individual

apiVersion: v1
kind: Pod
metadata:
name: {% name(user.name, user.image, user.selector_profile) %}
spec:
automountServiceAccountToken: false
volumes:
- name: homedir
persistentVolumeClaim:
name: {% name(user.name) %}
@yuvipanda
yuvipanda / calculate.mprof
Created February 16, 2018 05:51
Memory profiling
Filename: /home/yuvipanda/align/calculate_alignment.py
Line # Mem usage Increment Line Contents
================================================
715 310.1 MiB 310.1 MiB @profile(stream=open("calculate_alignment.mprof", "w"))
716 def calculate_alignment(input_files,
717 output_file_directory,
718 semantic_model_input_file,
719 pretrained_input_file,
720 high_sd_cutoff=3,
@yuvipanda
yuvipanda / upload.md
Created February 3, 2018 00:47
upload flow

Workflow is:

  1. Click link on EdX site for specific lab
  2. Takes you to a website (that we build) that has instructions on getting the labs, installing them locally and editing text files
  3. Has a space to upload the file after testing. On upload, we save it somewhere nice so we can grade it along everyone else.

Things to build:

  1. Website that does LTI Authentication + displays text based on which homework is required
  2. Same website should allow uploading a file, possibly multiple times, and saving that in a central location. Must make sure that files are saved properly.

autograde

A online grading microservice

What is grading?

Grading in this case is:

  1. Take a given payload (notebooks, code files, url with zip files, etc)
"""
The tests will be checked in order, and the first one to fail will have
its docstring (in markdown) shown to the user.
The user submitted notebook has already been executed, and the contents of
the global namespace there is passed in as `ns` to each function.
You can use `@scored` decorator to specify that if a student gets all the
tests right, up to that test, they can be awarded that score.
[W 2017-07-24 07:54:35.097 JupyterHub base:372] User j-tiny-1-v71gl70's server is slow to become responsive (timeout=10)
[D 2017-07-24 07:54:35.108 JupyterHub base:373] Expecting server for j-tiny-1-v71gl70 at: http://10.244.12.113:8888/user/j-tiny-1-v71gl70/
[D 2017-07-24 07:54:36.517 JupyterHub base:265] Setting cookie for j-tiny-1-v71gl70: jupyter-hub-token, {'httponly': True}
[I 2017-07-24 07:54:36.522 JupyterHub login:113] User logged in: j-tiny-1-v71gl70
[I 2017-07-24 07:54:37.795 JupyterHub log:122] 302 GET /hub/spawn \u2192 /user/j-tiny-1-v71gl70/ (j-tiny-1-v71gl70@10.240.0.10) 11.22ms
[I 2017-07-24 07:54:38.657 JupyterHub log:122] 302 GET /user/j-tiny-1-v71gl70/ \u2192 /hub/user/j-tiny-1-v71gl70/ (j-tiny-1-v71gl70@10.240.0.10) 3.97ms
[I 2017-07-24 07:54:40.091 JupyterHub log:122] 200 GET /hub/user/j-tiny-1-v71gl70/ (j-tiny-1-v71gl70@10.240.0.10) 11.90ms
[I 2017-07-24 07:54:44.371 JupyterHub log:122] 200 GET /hub/user/j-tiny-1-v71gl70/ (j-tiny-1-v71gl70@10.240.0.10) 11.63ms
[I 2017-07-24 07:54:51.757
[W 2017-07-22 08:53:15.505 JupyterHub base:361] User j-benchmark-1-g42gx77's server is slow to start (timeout=10)
[I 2017-07-22 08:53:15.560 JupyterHub login:113] User logged in: j-benchmark-1-g42gx77
[I 2017-07-22 08:53:15.883 JupyterHub log:122] 302 GET /hub/spawn \u2192 /user/j-benchmark-1-g42gx77/ (j-benchmark-1-g42gx77@10.244.6.49) 7.32ms
[I 2017-07-22 08:53:16.552 JupyterHub log:122] 302 GET /user/j-benchmark-1-g42gx77/ \u2192 /hub/user/j-benchmark-1-g42gx77/?times=1 (j-benchmark-1-g42gx77@10.244.6.49) 567.88ms
[I 2017-07-22 08:53:17.129 JupyterHub log:122] 200 GET /hub/user/j-benchmark-1-g42gx77/?times=1 (j-benchmark-1-g42gx77@10.244.6.49) 4.31ms
[I 2017-07-22 08:53:17.706 JupyterHub base:339] User j-benchmark-1-g42gx77 server took 12.485 seconds to start
[I 2017-07-22 08:53:17.712 JupyterHub proxy:232] Adding user j-benchmark-1-g42gx77 to proxy /user/j-benchmark-1-g42gx77/ => http://10.244.6.58:8888
[I 2017-07-22 08:53:18.231 JupyterHub proxy:120] Created endpoints/jupyter--2fuser-2fj-2dbenchmark-2d1-