envsubst
to make that easy if you dont wanna mess with sed :) https://stackoverflow.com/a/14157575
for example:
# this is /opt/polynote.conf.template
listen:
host: 0.0.0.0
port: 8192
kernel:
host: ${HOST_IP}
port_range: ${KERNEL_PORTS}
And then in your server container launch script, before launching the serverenvsubst '${HOST_IP} ${KERNEL_PORTS}' < /opt/polynote.conf.template > /opt/polynote.conf
Hey all, I'm having a little trouble with bringing my library into polynote and using it and hoping someone here could point me in the right direction, I have a trait in an imported library that takes a higher kinded type parameter:
trait Client[F[_]]{
}
but when importing it into polynote and attempting to extend it like:
import cats.effect.IO
object SomeApp extends Client[IO]{
}
and run the program I get the error: my.library.Client does not take type parameters
cats.effect.IO takes no type parameters, expected: one
io.circe.Json
. Are there any known issues/conflicts with the circe library?
The exact dependencies I'm using are io.circe:circe-core_2.12:0.13.0, io.circe:circe-generic_2.12:0.13.0, io.circe:circe-parser_2.12:0.13.0
. The notebook looks like:
import io.circe.parser.parse
import io.circe.generic.auto._
val json = """{"some":"json", "other":"stuff"}"""
val parsedJson = parse(json)
and the error message is:
Uncaught exception: scala.Product.$init$(Lscala/Product;)V (java.lang.NoSuchMethodError)
io.circe.Json.<init>(Json.scala:16)
io.circe.Json$JNull$.<init>(Json.scala:265)
io.circe.Json$JNull$.<clinit>(Json.scala:-1)
io.circe.Json$.<init>(Json.scala:451)
io.circe.Json$.<clinit>(Json.scala:-1)
io.circe.jawn.CirceSupportParser$UnlimitedFacade.jstring(CirceSupportParser.scala:100)
io.circe.jawn.CirceSupportParser$UnlimitedFacade$$anon$8.add(CirceSupportParser.scala:110)
org.typelevel.jawn.CharBasedParser.parseString(CharBasedParser.scala:96)
org.typelevel.jawn.CharBasedParser.parseString$(CharBasedParser.scala:93)
org.typelevel.jawn.StringParser.parseString(StringParser.scala:15)
org.typelevel.jawn.Parser.rparse(Parser.scala:445)
org.typelevel.jawn.Parser.parseTop(Parser.scala:380)
org.typelevel.jawn.Parser.parse(Parser.scala:364)
org.typelevel.jawn.SyncParser.parse(SyncParser.scala:23)
org.typelevel.jawn.SupportParser.$anonfun$parseFromString$1(SupportParser.scala:15)
......
println
it ought to just work... with kernel.display
you'd need iLogStuff
to take an implicit KernelRuntime
so that it gets the one from the calling cell
<name>@<server name redacted>$ polynote.py run HelloWorld.ipynb
['java', '-cp', 'polynote.jar:polynote.jar:/mnt/c/Users/<username>/Development/polynote/deps/polynote-runtime.jar:/mnt/c/Users/<username>/Development/polynote/deps/polynote-spark-runtime.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-collection-compat_2.12-2.1.1.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-compiler.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-library.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-reflect.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-xml_2.12-1.2.0.jar:', '-Djava.library.path=/home/lars/.local/lib/python3.8/site-packages/jep', 'polynote.Main', 'run', 'HelloWorld.ipynb']
[INFO] Loading configuration from config.yml
[INFO] Deploying with command:
| /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -cp polynote.jar:polynote.jar:/mnt/c/Users/<username>/Development/polynote/deps/polynote-run
time.jar:/mnt/c/Users/<username>/Development/polynote/deps/polynote-spark-runtime.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-collection-compat_2.12-2.1.1.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-compiler.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-library.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-reflect.jar:/mnt/c/Users/<username>/Development/polynote/deps/scala-xml_2.12-1.2.0.jar: -Djava.library.path=/home/lars/.local/lib/python3.8/site-packages/jep polynote.kernel.remote.RemoteKernelClient --address 127.0.0.1 --port 57471 --kernelFactory polynote.kernel.LocalKernelFactory