JuliaTutor.jl icon indicating copy to clipboard operation
JuliaTutor.jl copied to clipboard

Discord integration options

Open mkschulze opened this issue 3 years ago • 3 comments

Hello,

I'd like to list two options that currently seem to be promising.

1. Editing Piston API to include the JuliaTutor package in the Docker container.

You would need to modify the Julia package and build it yourself, then you can install the package into the stock piston container

https://github.com/engineer-man/piston/blob/master/packages/julia/1.5.4/build.sh

#!/usr/bin/env bash

# Install location
PREFIX=$(realpath $(dirname $0))

mkdir -p build
cd build

# Download and extract Julia source
curl -L "https://github.com/JuliaLang/julia/releases/download/v1.5.4/julia-1.5.4.tar.gz" -o julia.tar.gz
tar xzf julia.tar.gz --strip-components=1

# Build
echo "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)
prefix=$PREFIX" > Make.user
make -j$(nproc)
make install -j$(nproc)

# Cleanup
cd ..
rm -rf build

Here the Docker container needs to be edited https://github.com/engineer-man/piston

And here the bot would need to be aware of the edited Piston API. https://github.com/Humans-of-Julia/piston-bot

Currently, when I try to install a package it throws a permission error, that's why we would need to include it ourselves. Bildschirmfoto 2021-05-15 um 17 54 19

2. Working it out with Discord.jl i.e. our HoJ bot directly.

You can send code to be run inside the Julia session on the server and have the results sent back, it would obviously lack a lot of features but it can at least cover the "run code" bits If you add your own parsing instead of just blindly evaling everything you can handle the other REPL modes too.

Here is a Gist that could work as an entry point. https://gist.github.com/christopher-dG/2d9327a1b4b3b24323c115dc179f87a2

mkschulze avatar May 15 '21 15:05 mkschulze

Maybe we can dial this back a step just for my understanding. What kind of integration do we want with this package? Here are some use cases I can envision:

  1. Julia tutor can be worked on in a chatroom and individuals can work on their own accord on whatever they like.
  2. There is a special chatroom with mentors available guiding lessons and walking a small group of users through some examples.
  3. A service that extends discord, IE: could be used on a website, etc.

Each of them have their own sort of needs.

The reason I am inclined to dial this back is - it sounds like we may need to change the API to be friendly for distributed users, or literally provide a Julia REPL to each user. IE: some lessons are relying on stored variables and their values between steps.

caseykneale avatar May 15 '21 16:05 caseykneale

Another option is, the JuliaTutor package itself plugs into discord?

User kicks up JuliaTutor, it authorizes to discord, it posts to the discord server as the user works through their progress?

caseykneale avatar May 15 '21 16:05 caseykneale

1. Julia tutor can be worked on in a chatroom and individuals can work on their own accord on whatever they like.

2. There is a special chatroom with mentors available guiding lessons and walking a small group of users through some examples.

These two sound most attractive to me personally, so users could do the HoJ School track and from time to time we do AMA sessions with mentors and coding challenges live.

But what happens when two users want to run it at the same time, could be conflicting in one channel. Maybe we would need two channels then, to allow reserving a channel.

mkschulze avatar May 15 '21 17:05 mkschulze