Go (golang) Jupyter Notebook kernel and an interactive REPL

Overview

lgo Binder Go Report Card

Go (golang) Jupyter Notebook kernel and an interactive REPL

Disclaimer

Since go1.10, this Go kernel has performance issue due to a performance regression in Go tool chain.

Also, this Go kernel can not be built with go1.12 due to another regression in Go tool chain.

Now, the compiler options this kernel relies on are completely broken and I'm not sure when they will fix the regressions. Unfortunately, they don't plan to fix this in go1.13 as of July 8th 2019. If you are interested in using this kernel, please upvote the bugs. For a while, please use other Go kernels if you want to use the later version of Go with Jupyter notebook.

Medium Post

Features

  • Write and execute Go (golang) interactively like Python.
  • Jupyter Notebook integration
  • Full Go (golang) language spec support. 100% gc (go compiler) compatible.
  • Code completion and inspection in Jupyter Notebooks
  • Display images, HTML, JavaScript, SVG, etc...
  • Currently, lgo is only supported on Linux. But you can use lgo on Mac and Windows with virtual machines or Docker.

Jupyter notebook examples

You can view example notebooks of lgo from Example notebooks on Jupyter nbviewer

If you want to execute these notebooks, you can try these notebooks on your browser without installation from Binder

Try lgo from your browser without installation

Binder

Thanks to binder (mybinder.org), you can try lgo on your browsers with temporary docker containers on binder. Open your temporary Jupyter Notebook from the button above and enjoy lgo.

Quick Start with Docker

  1. Install Docker and Docker Compose.
  2. Clone the respository and run the docker container with docker-compose.
> git clone https://github.com/yunabe/lgo.git
> cd lgo/docker/jupyter
> docker-compose up -d

If you want to use a port other than 8888 on host, update ports config in lgo/docker/jupyter/docker-compose.yaml before running docker-compose up.

  1. Get the URL to open the Jupyter Notebook
> docker-compose exec jupyter jupyter notebook list
Currently running servers:
http://0.0.0.0:8888/?token=50dfee7e328bf86e70c234a2f06021e1df63a19641c86676 :: /examples
  1. Open the Jupyter Notebook server with the authentication token above.

Linux/Mac OS

If you are using Linux or Mac OS, you can use start/stop scripts instead. Web browser will open the URL automatically.

# start server
> ./up.sh
# stop server
> ./down.sh

Install

Prerequisites

Install

  • go get github.com/yunabe/lgo/cmd/lgo && go get -d github.com/yunabe/lgo/cmd/lgo-internal
    • This installs lgo command into your $(go env GOPATH)/bin
  • Set LGOPATH environment variable
    • lgo install will install binaries into the directory specified with LGOPATH.
    • You can use any empty directory with write permission as LGOPATH.
  • Run lgo install
    • This installs std libraries and the internal lgo tool into LGOPATH with specific compiler flags.
    • If lgo install fails, please check install log stored in $LGOPATH/install.log
  • (Optional) Run lgo installpkg [packages] to install third-party packages to LGOPATH
    • You can preinstall third-party packages into LGOPATH.
    • This step is optional. If packages are not preinstalled, lgo installs the packages on the fly.
    • But, installing packages is a heavy and slow process. I recommend you to preinstall packages which you will use in the future with high probability.
    • If lgo installpkg fails, please check the log stored in $LGOPATH/installpkg.log.
    • See go's manual about the format of [packages] args.
  • Install the kernel configuration to Jupyter Notebook
    • python $(go env GOPATH)/src/github.com/yunabe/lgo/bin/install_kernel
    • Make sure to use the same version of python as you used to install jupyter. For example, use python3 instead of python if you install jupyter with pip3.
  • (Optional) If you want to use lgo with JupyterLab, install a jupyterlab extension for lgo
    • jupyter labextension install @yunabe/lgo_extension
    • This extension adds "Go Format" button to the toolbar in JupyterLab.

Usage: Jupyter Notebook

  • Run jupyter notebook command to start Juyputer Notebook and select "Go (lgo)" from New Notebook menu.
  • To show documents of packages, functions and variables in your code, move the cursor to the identifier you want to inspect and press Shift-Tab.
  • Press Tab to complete code
  • Click Format Go button in the toolbar to format code.
  • lgo works with JupyterLab. To use lgo from JupyterLab, install JupyterLab and run jupyter lab.

Usage: REPL console

You can use lgo from command line with Jupyter Console or build-in REPL mode of lgo

Jupyter Console (Recommended)

Run jupyter console --kernel lgo

In [1]: a, b := 3, 4

In [2]: func sum(x, y int) int {
      :     return x + y
      :     }

In [3]: import "fmt"

In [4]: fmt.Sprintf("sum(%d, %d) = %d", a, b, sum(a, b))
sum(3, 4) = 7

built-in REPL mode

Run lgo run

>> fmt.Sprintf("sum(%d, %d) = %d", a, b, sum(a, b)) sum(3, 4) = 7 ">
$ lgo run
>>> a, b := 3, 4
>>> func sum(x, y int) int {
...     return x + y
...     }
>>> import "fmt"
>>> fmt.Sprintf("sum(%d, %d) = %d", a, b, sum(a, b))
sum(3, 4) = 7

Tips

go get and lgo

The packages you want to use in lgo must be prebuilt and installed into $LGOPATH by lgo install command. Please make sure to run lgo install after you fetch a new package with go get command.

Update go version

Please run lgo install --clean after you update go version.

lgo install installs prebuilt packages into $LGOPATH. When you update go version, you need to reinstall these prebuilt packages with the newer go because binary formats of prebuilt packages may change in the newer version of go.

Display HTML and images

To display HTML and images in lgo, use _ctx.Display. See the example of _ctx.Display in an example notebook

Cancellation

In lgo, you can interrupt execution by pressing "Stop" button (or pressing I, I) in Jupyter Notebook and pressing Ctrl-C in the interactive shell.

However, as you may know, Go does not allow you to cancel running goroutines with Ctrl-C. Go does not provide any API to cancel specific goroutines. The standard way to handle cancellation in Go today is to use context.Context (Read Go Concurrency Patterns: Context if you are not familiar with context.Context in Go).

lgo creates a special context _ctx on every execution and _ctx is cancelled when the execution is cancelled. Please pass _ctx as a context.Context param of Go libraries you want to cancel. Here is an example notebook of cancellation in lgo.

Memory Management

In lgo, memory is managed by the garbage collector of Go. Memory not referenced from any variables or goroutines is collected and released automatically.

One caveat of memory management in lgo is that memory referenced from global variables are not released automatically when the global variables are shadowed by other global variables with the same names. For example, if you run the following code blocks, the 32MB RAM reserved in [1] is not released after executing [2] and [3] because

  • [2] does not reset the value of b in [1]. It just defines another global variable b with the same name and shadows the reference to the first b.
  • [3] resets b defined in [2]. The memory reserved in [2] will be released after [3]. But the memory reserved in [1] will not be released.
[1]
// Assign 32MB ram to b.
b := make([]byte, 1 << 25)
[2]
// This shadows the first b.
b := make([]byte, 1 << 24)
[3]
// This sets nil to the second b.
b = nil

go1.10

lgo works with go1.10. But the overhead of code execution is 4-5x larger in go1.10 than go1.9. It is due to a regression of the cache mechnism of go install in go1.10. I recommend you to use lgo with go1.9 until the bug is fixed in go1.10.

Comparisons with similar projects

gore

gore, which was released in Feb 2015, is the most famous REPL implementation for Go as of Dec 2017. gore is a great tool to try out very short code snippets in REPL style.

But gore does not fit to data science or heavy data processing at all. gore executes your inputs by concatinating all of your inputs, wrapping it with main function and running it with go run command. This means every time you input your code, gore executes all your inputs from the begining. For example, if you are writing something like

  1. Loads a very large CSV file as an input. It takes 1 min to load.
  2. Analyzes the loaded data. For example, calculates max, min, avg, etc..

gore always runs the first step when you calculate something and you need to wait for 1 min every time. This behavior is not acceptable for real data science works. Also, gore is not good at tyring code with side effects (even fmt.Println) because code snippets with side effects are executed repeatedly and repeatedly. lgo chose a totally different approach to execute Go code interactively and does not have the same shortcoming.

gore is a CLI tool and it does not support Jupyter Notebook.

gophernotes

lgo gophernotes
Backend gc (go compiler) An unofficial interpreter
Full Go Language Specs ✔️
100% gc compatible ✔️
Static typing ✔️ to some extent
Performance Fast Slow
Overhead 500ms 1ms
Cancellation ✔️
Code completion ✔️
Code inspection ✔️
Code formatting ✔️
Display HTML and images ✔️
Windows, Mac Use Docker or VM Partial
License BSD LGPL

gophernotes was the first Jupyter kernel for Go, released in Jan 2016. Before Sep 2017, it used the same technology gore uses to evaluate Go code. This means it did not fit to heavy data processing or data analysis at all. From Sep 2017, gophernotes switched from go run approach to gomacro, one of unofficial golang interpreters by cosmos72. This solved the problem gore has. Now, the code execution mechnism of gophernotes also fits to heavy data analysis.

The shortcomings of using an unofficial interpreter are

  • It does not support all Go language features. Especially, it does not support one of the most important Go feature, interface. As of go1.10, it is hard to support interface in an interpreter written in Go because of the lack of API in reflect package.
  • Interpreters are generally slow.
  • Unofficial interpreters are not well-tested compared to the official gc (go compiler) tools.

The advantages of this approach are

  • The overhead of code execution is small because it does not compile and link code.
  • Windows/Mac partial support. lgo works only on Linux and you need to use VMs or Docker to run it on Windows/Mac. gophernotes (gomacro) works on Windows/Mac natively if you do not need third-party packages.

These disadvantage and advantages are not something inevitable in interperters. But they are not easy to solve under the limited development resource.

Also, lgo kernel supports more rich features in Jupyter Notebook as of Dec 2017, including code completion, code inspection and images/HTML/JavaScript output supports.

Troubleshooting

Dead kernel

Symptom

Got an error message like:

Kernel Restarting
The kernel appears to have died. It will restart automatically.

Solutions

First, please confirm your code does not call os.Exit directly or indirectly. In lgo, your code is executed in the processs of lgo kernel. If you evaluate os.Exit in lgo, it terminates the lgo kernel process and jupyter notebook server loses the connection with the kernel. Thus, you must not evaluate os.Exit or functions that call it internally (e.g. log.Fatal) in lgo.

If os.Exit is not the reason of "Dead kernel", please check crash logs of the kernel. If you run your notebook with jupyter notebook command in a terminal, the crash log should be there. If you run your notebook in docker, attach the container's terminal with docker attach to view the logs. If you can see the logs of jupyter notebook, you should see logs like

2018/03/01 20:30:45 lgo-internal failed: exit status 1
[I 22:34:00.500 NotebookApp] KernelRestarter: restarting kernel (1/5)
kernel abcd1234-5678-efghi-xxxx-777eeffcccbb restarted

and you can probably see helpful information before lgo-internal failed message.

multiple roots

Sympton

Got an error message like:

multiple roots $LGOPATH/pkg &
Failed to build a shared library of github.com/yunabe/lgo/sess7b..7d/exec1: exit status 1

Solutions

This error occurs when the go command you are currently using is different from the go command you used to run lgo install. For example, this happens if you update go from 1.9 to 1.10 but did not run lgo install --clean with the new go after the update.

If you encouter this issue, please double-check that you are using go which you used to run lgo install to install packages into $LGOPATH.

old export format no longer supported

Symptom

Got error messages like:

could not import github.com/yunabe/mylib (/home/yunabe/local/gocode/pkg/linux_amd64/github.com/yunabe/mylib.a: import "github.com/yunabe/mylib": old export format no longer supported (recompile library))

Reason and Solution

Some libraries installed in your $GOPATH are in the old format, which are built go1.6 or before. Make sure all libraries under your $GOPATH are recompiled with your current go compiler.

cd $GOPATH/src; go install ./...
Comments
  • can't work on termux Arch Linux in Android aarch64

    can't work on termux Arch Linux in Android aarch64

    In [1]: s =3 panic: Failed to import core: cannot import, possibly version skew (unknown export format version -1 ("i\x00\xfb\x0f\xd3\x1c4/home/dlin/go/src/github.com/yunabe/lgo/core/core.go\x1agithub.com/yunabe/lgo/core\x00\aContext\acontext\aDisplay\rDataDisplayer")) - reinstall package

    opened by dlintw 10
  • Trying to install Kubernetes client-go package fails

    Trying to install Kubernetes client-go package fails

    Hi, and thanks for the awesome project!

    I'm trying to install the Kubernetes client-go so I can use it in a notebook. This is what I'm trying to do in the Dockerfile:

    RUN go get k8s.io/client-go/...
    
    RUN go get github.com/tools/godep
    
    RUN cd /go/src/k8s.io/client-go && godep restore
    RUN lgo installpkg k8s.io/client-go/...
    

    While most of the packages seem to be installed correctly, some of them fail in the following way:

     /tmp/go-build734525261/libk8s.io-client-go-tools-portforward.so
    k8s.io/apimachinery/pkg/apis/meta/v1.ParseToLabelSelector: missing section for relocation target k8s.io/apimachinery/pkg/util/sets.String.PopAny
    k8s.io/apimachinery/pkg/apis/meta/v1.ParseToLabelSelector: reloc 8 to non-elf symbol k8s.io/apimachinery/pkg/util/sets.String.PopAny (outer=k8s.io/apimachinery/pkg/util/sets.String.PopAny) 0
    k8s.io/apimachinery/pkg/apis/meta/v1.ParseToLabelSelector: undefined: "k8s.io/apimachinery/pkg/util/sets.String.PopAny"
    (336/348) failed to install "k8s.io/client-go/tools/portforward": exit status 2
    # /tmp/go-build519294519/libk8s.io-apimachinery-pkg-util-remotecommand.so
    k8s.io/apimachinery/pkg/apis/meta/v1.ParseToLabelSelector: missing section for relocation target k8s.io/apimachinery/pkg/util/sets.String.PopAny
    k8s.io/apimachinery/pkg/apis/meta/v1.ParseToLabelSelector: reloc 8 to non-elf symbol k8s.io/apimachinery/pkg/util/sets.String.PopAny (outer=k8s.io/apimachinery/pkg/util/sets.String.PopAny) 0
    k8s.io/apimachinery/pkg/apis/meta/v1.ParseToLabelSelector: undefined: "k8s.io/apimachinery/pkg/util/sets.String.PopAny"
    

    Although it seems to be an issue with the package itself, I want to make sure that:

     reloc 8 to non-elf symbol 
     missing section for relocation target 
    

    are not issues with the compatibility of this project.

    Thanks!

    opened by radu-matei 9
  • Go (lgo) Kernel not available when container is created with volume bind

    Go (lgo) Kernel not available when container is created with volume bind

    The docker image seems to have a problem with bind volumes and finding the Go (lgo) Kernel in the Jupyter notebook.

    If I start the standard way:

    docker pull yunabe/lgo
    docker run --name lgo -p 8888:8888 -d yunabe/lgo
    docker exec lgo jupyter notebook list 
    

    Everything is fine. Open the browser at localhost:8888 and enter the Jupyter notebook. If I start a new notebook, I can choose between Go(lgo) and Python 2 Kernel.

    But if I create the container and bind a volume to it, the Go(lgo) Kernel is not available within the Jupyter notebook:

    docker pull yunabe/lgo
    docker run --name lgo -v ~/jupyter:/home/gopher -p 8888:8888 -d yunabe/lgo
    docker exec lgo jupyter notebook list 
    

    I am now able to create new notebooks, which get synchronized to the local folder, but not with Go. What am I missing?

    Docker version is the following:

    $docker docker version
    Client:
     Version:      18.03.1-ce
     API version:  1.37
     Go version:   go1.9.5
     Git commit:   9ee9f40
     Built:        Thu Apr 26 07:13:02 2018
     OS/Arch:      darwin/amd64
     Experimental: false
     Orchestrator: swarm
    
    Server:
     Engine:
      Version:      18.03.1-ce
      API version:  1.37 (minimum version 1.12)
      Go version:   go1.9.5
      Git commit:   9ee9f40
      Built:        Thu Apr 26 07:22:38 2018
      OS/Arch:      linux/amd64
      Experimental: true
    
    opened by dirkolbrich 5
  • dataframe package does not work

    dataframe package does not work

    Hi,

    I noticed that there is dataframe package installed. But it does not work properly when calling import. Thanks.

    import "github.com/kniren/gota/dataframe"
    
    1:8: could not import github.com/kniren/gota/dataframe (open /lgo/pkg/github.com/kniren/gota/dataframe.a: no such file or directory)
    
    opened by cigoic 5
  • type and its methods must be in the same jupyter cell

    type and its methods must be in the same jupyter cell

    Declaring a type B in one cell, and its methods in another cell, produces the error:

    1:7: invalid receiver github.com/yunabe/lgo/sess7b2274696d65223a313532333232333935393234383932303932307d/exec2.B (type not defined in this package)

    I'd say it's a limitation rather than a bug - inconvenient, nevertheless

    yunabe-lgo-method-in-different-cell

    opened by cosmos72 5
  • Open boltDB makes kernel dead.

    Open boltDB makes kernel dead.

    Trying to opening database make kernel dead.

    I install bold DB container & log install got 2018/02/28 06:36:17 lgo was installed in /lgo successfully message.

    and I run below code. got kernel dead.

    import (
    	"log"
    
    	"github.com/boltdb/bolt"
    )
    
    func main() {
    	// Open the my.db data file in your current directory.
    	// It will be created if it doesn't exist.
    	db, err := bolt.Open("my.db", 0600, nil)
    	if err != nil {
    		log.Fatal(err)
    	}
    	defer db.Close()
    
    }
    
    main()
    

    from

    my.db file created.

    I think it's not involved with file. golang-scribble makes dir and json file well.

    opened by mcdoyaji 4
  • Need documenting difference jupyter notebook bin names.

    Need documenting difference jupyter notebook bin names.

    I tried install nbextensions got erros.

    and figured out bin file name is different from nomals.

    jupyter-contrib tells jupyter nbextensions_configurator enable --user, but there is no contrib things.

    so many tries. so get the bin path like below.

    $ pip uninstall jupyter_nbextensions_configurator
    Uninstalling jupyter-nbextensions-configurator-0.4.0:
      /home/gopher/.local/bin/jupyter-nbextensions_configurator
      /home/gopher/.local/lib/python2.7/site-packages/jupyter_nbextensions_configurator-0.4.0.dist-info/DESCRIPTION.rst
    
    

    lgo has another bin names.

    ~/.local/bin$ ls
    easy_install                 jupyter-kernelspec
    easy_install-2.7             jupyter-migrate
    iptest                       jupyter-nbconvert
    iptest2                      jupyter-nbextension
    ipython                      jupyter-nbextensions_configurator
    ipython2                     jupyter-notebook
    jsonschema                   jupyter-run
    jupyter                      jupyter-serverextension
    jupyter-bundlerextension     jupyter-troubleshoot
    

    I don't know what's origin, but we need documentation about it.

    for avoiding so many time wasting.

    opened by mcdoyaji 4
  • replace glog with log

    replace glog with log

    I've been trying to use gojupyterscaffold to write a new kernel (not Go), but I found that it uses glog, which defines its own set of flags, e.g., log_dir and logtostderr, which conflicts with other logging modules we are using. Is it possible to stop using glog in lgo's library packages and instead use the standard log? Or at least have some indirection mechanism so that they don't need to hardcode dependencies on glog?

    opened by yasushi-saito 3
  • Docker build fails with a pip error

    Docker build fails with a pip error

    I tried building my own docker image based on the Dockerfiles in the repo, but both the one in image and the one in image_py3 fail with the below error:

    Step 3/18 : RUN pip install --upgrade pip && pip install -U jupyter jupyterlab && jupyter serverextension enable --py jupyterlab --sys-prefix
     ---> Running in 88f135bba7be
    Collecting pip
      Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
    Installing collected packages: pip
      Found existing installation: pip 9.0.1
        Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
    Successfully installed pip-10.0.1
    Traceback (most recent call last):
      File "/usr/bin/pip", line 9, in <module>
        from pip import main
    ImportError: cannot import name main
    The command '/bin/sh -c pip install --upgrade pip && pip install -U jupyter jupyterlab && jupyter serverextension enable --py jupyterlab --sys-prefix' returned a non-zero code: 1
    

    My docker version

    λ docker version
    Client:
     Version:       18.03.0-ce
     API version:   1.37
     Go version:    go1.9.4
     Git commit:    0520e24
     Built: Wed Mar 21 23:06:28 2018
     OS/Arch:       windows/amd64
     Experimental:  false
     Orchestrator:  swarm
    
    Server:
     Engine:
      Version:      18.03.0-ce
      API version:  1.37 (minimum version 1.12)
      Go version:   go1.9.4
      Git commit:   0520e24
      Built:        Wed Mar 21 23:14:32 2018
      OS/Arch:      linux/amd64
      Experimental: false
    

    Any thoughts?

    opened by retgits 3
  •  sql: unknown driver

    sql: unknown driver "postgres" (forgotten import?)

    When I try to use postgres driver Got errors below.

    2018/03/02 02:42:04 sql: unknown driver "postgres" (forgotten import?)
    panic: runtime error: invalid memory address or nil pointer dereference
    
    goroutine 28 [running]:
    runtime/debug.Stack(0xc400000008, 0x7fc528288490, 0xc42032f370)
    	/usr/local/go/src/runtime/debug/stack.go:24 +0xa9
    github.com/yunabe/lgo/core.(*resultCounter).recordResult(0xc42032f358, 0x7fc52819a1a0, 0x7fc5285aa460)
    	/go/src/github.com/yunabe/lgo/core/core.go:91 +0xce
    github.com/yunabe/lgo/core.(*resultCounter).recordResultInDefer(0xc42032f358)
    	/go/src/github.com/yunabe/lgo/core/core.go:96 +0x3b
    panic(0x7fc52819a1a0, 0x7fc5285aa460)
    	/usr/local/go/src/runtime/panic.go:491 +0x294
    database/sql.(*DB).Close(0x0, 0x22, 0x0)
    	/usr/local/go/src/database/sql/sql.go:657 +0x3c
    panic(0x7fc52819a1a0, 0x7fc5285aa460)
    	/usr/local/go/src/runtime/panic.go:491 +0x294
    database/sql.(*DB).conn(0x0, 0x7ed2c0, 0xc420332048, 0x1, 0xc420182600, 0xc42037d6d0, 0xc42038e0c0)
    	/usr/local/go/src/database/sql/sql.go:930 +0x3c
    database/sql.(*DB).PingContext(0x0, 0x7ed2c0, 0xc420332048, 0xc4204abf08, 0x0)
    	/usr/local/go/src/database/sql/sql.go:631 +0x93
    database/sql.(*DB).Ping(0x0, 0x7fc528270f80, 0x0)
    	/usr/local/go/src/database/sql/sql.go:649 +0x48
    github.com/yunabe/lgo/sess7b2274696d65223a313531393935383436353337313035313531397d/exec2.lgo_init()
    	/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313531393935383436353337313035313531397d/exec2/src.go:31 +0x262
    github.com/yunabe/lgo/cmd/runner.loadShared.func3()
    	/go/src/github.com/yunabe/lgo/cmd/runner/runner.go:60 +0x26
    github.com/yunabe/lgo/core.startExec.func1(0xc42032f320, 0xc4201d4bf0)
    	/go/src/github.com/yunabe/lgo/core/core.go:247 +0x83
    created by github.com/yunabe/lgo/core.startExec
    	/go/src/github.com/yunabe/lgo/core/core.go:244 +0xcb
    main routine failed
    

    the code is here.

    import (
    	"database/sql"
    	"log"
    	"os"
        
        "github.com/lib/pq"
    )
    
    	pgURL := os.Getenv("PGURL")
    	if pgURL == "" {
    		log.Println("PGURL empty")
    	}
    
    	db, err := sql.Open("postgres", pgURL)
    	if err != nil {
    		log.Println(err)
    	}
    	defer db.Close()
    
    	if err := db.Ping(); err != nil {
    		log.Println(err)
    	}
    
    • pg installed
    • PGURL setted
    • already lgo install process succesfully
    /go/src/github.com/lib/pq$ ls
    CONTRIBUTING.md  conn_test.go    issues_test.go        ssl_test.go
    LICENSE.md       copy.go         notify.go             ssl_windows.go
    README.md       ......
    
    $PGURL
    bash: "postgres://gopher:[email protected]": No such file or directory
    
    $ lgo install
    2018/03/02 02:48:42 Install lgo to /lgo
    ....
    2018/03/02 02:48:46 (16/115) Building "github.com/lib/pq"
    .....
    2018/03/02 02:49:01 (115/115) Building "gonum.org/v1/plot/vg/vgtex"
    2018/03/02 02:49:01 Installing lgo-internal
    2018/03/02 02:49:05 lgo was installed in /lgo successfully
    

    How to use (postgres) database in Lgo?

    opened by mcdoyaji 3
  • Support multi-byte-encoded filenames in prebuilt docker image

    Support multi-byte-encoded filenames in prebuilt docker image

    If file path or filename has non-ascii character, got errors.

    I'm using docker-toolbox on windows 10. and Lgo container python's default character set is below.

    $ python
    Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
    [GCC 6.3.0 20170516] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.stdin.encoding
    'ANSI_X3.4-1968'
    >>> 
    

    And urf-8 character not supported default in python2.

    >>> import sys
    >>> sys.stdin.encoding
    'ANSI_X3.4-1968'
    >>> b = '가'
    >>> b
    '\xb0\xa1'
    
    

    So how about updating python version to 3.x ?

    opened by mcdoyaji 3
  • SyntaxError: invalid syntax for import

    SyntaxError: invalid syntax for import "fmt" in Jupyter

    Issue 1: While running in jupyter notebook

    import "fmt"
    
    File "<ipython-input-15-c778ddbffe65>", line 1
        import "fmt"
               ^
    SyntaxError: invalid syntax
    

    go version go1.15.1 linux/amd64

    issue 2 : While clicking the format go button in jupyter we can see warning in console

    [IPKernelApp]` WARNING | Unknown message type: 'gofmt_request

    What can be done to fix this?

    opened by ominidx 0
  • Gorgonia Hello world in Jupyter Notebook

    Gorgonia Hello world in Jupyter Notebook

    I'm trying to run through the hello world tutorial for the Gorgonia library in a Jupyter notebook (using lgo as the kernel). I can build this example just fine normally, but the call to gorgonia.Add() results in a panic:

    
    goroutine 25 [running]:
    runtime/debug.Stack(0xc0004c5898, 0x8, 0xc00000f7e0)
    	/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
    github.com/yunabe/lgo/core.(*resultCounter).recordResult(0xc0000b0158, 0x7fbcc935dfc0, 0x7fbcc996b5b0)
    	/home/user/go/src/github.com/yunabe/lgo/core/core.go:95 +0xdd
    github.com/yunabe/lgo/core.(*resultCounter).recordResultInDefer(0xc0000b0158)
    	/home/user/go/src/github.com/yunabe/lgo/core/core.go:100 +0x3b
    panic(0x7fbcc935dfc0, 0x7fbcc996b5b0)
    	/usr/local/go/src/runtime/panic.go:679 +0x1be
    sync.(*Map).Load(0x0, 0x7fbcc924f360, 0xc0004c5ad0, 0x0, 0xc0004c5b48, 0x7fbca161c6fd)
    	/usr/local/go/src/sync/map.go:103 +0x2b
    gorgonia.org/gorgonia.borrowDimSizers(0x2, 0xc0004c5a98, 0xc000215cb0, 0x3)
    	/home/user/go/src/gorgonia.org/gorgonia/perf.go:90 +0x56
    gorgonia.org/gorgonia.Nodes.dimSizers(0xc0008c4060, 0x2, 0x2, 0x0, 0x0, 0x7fbca174d020)
    	/home/user/go/src/gorgonia.org/gorgonia/collections.go:212 +0x31
    gorgonia.org/gorgonia.ApplyOp(0x7fbca174dc20, 0xc0008f8000, 0xc0008c4060, 0x2, 0x2, 0x0, 0x0, 0x0)
    	/home/user/go/src/gorgonia.org/gorgonia/op.go:198 +0x390
    gorgonia.org/gorgonia.binOpNode(0x7fbca174e420, 0xc0008f8000, 0xc0004be000, 0xc0004be0e0, 0x0, 0x0, 0x0)
    	/home/user/go/src/gorgonia.org/gorgonia/operations.go:43 +0x2f0
    gorgonia.org/gorgonia.Add(0xc0004be000, 0xc0004be0e0, 0x0, 0xc0004c5f10, 0x1)
    	/home/user/go/src/gorgonia.org/gorgonia/api_gen.go:66 +0x16f
    github.com/yunabe/lgo/sess7b2274696d65223a313538353731383931393336393137383933307d/exec4.lgo_init()
    	/home/user/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313538353731383931393336393137383933307d/exec4/src.go:16 +0x188
    github.com/yunabe/lgo/cmd/runner.loadShared.func3()
    	/home/user/go/src/github.com/yunabe/lgo/cmd/runner/runner.go:62 +0x26
    github.com/yunabe/lgo/core.startExec.func1(0xc0000b0120, 0xc000943570)
    	/home/user/go/src/github.com/yunabe/lgo/core/core.go:256 +0xa0
    created by github.com/yunabe/lgo/core.startExec
    	/home/user/go/src/github.com/yunabe/lgo/core/core.go:253 +0xcb
    main routine failed```
    
    Does anybody know what's causing this?
    opened by seedrick 0
  • sharing c:\driver for docker-compose

    sharing c:\driver for docker-compose

    Hi i'm unable to share the C:\ driver although it shows up a password authentication mechanism. Typically we enter the org userid/password . Can you please confirm.

    Thanks

    PS Here is the error message :ERROR: for jupyter_jupyter_1 Cannot create container for service jupyter: b'Drive sharing failed for an unknown reason'

    opened by kthulsidoss 0
  • Cannot auto complete in the juyter-lab

    Cannot auto complete in the juyter-lab

    Cannot auto complete in the juyter lab, Unable to use shortcut keys Tab+Shift,Version 0.35.6,Jupyter notebook no problem. lgo: image python3: image

    @yunabe/lgo_extension Click is invalid

    image

    opened by mayongze 2
  • centos7 lgo run  error

    centos7 lgo run error

    (condaEnv) [[email protected]_content_embedding bin]# lgo kernel F0423 10:32:17.532773 22023 kernel.go:301] Failed to create a server: Failed to read : open : no such file or directory goroutine 1 [running]: github.com/golang/glog.stacks(0xc0004c6000, 0xc0004300d0, 0x7a, 0xcc) /data/algorithm/src/github.com/golang/glog/glog.go:769 +0xd6 github.com/golang/glog.(*loggingT).output(0x5556b507eea0, 0xc000000003, 0xc000408370, 0x5556b5077f82, 0x9, 0x12d, 0x0) /data/algorithm/src/github.com/golang/glog/glog.go:720 +0x33c github.com/golang/glog.(*loggingT).printf(0x5556b507eea0, 0xc000000003, 0x5556b4f613b8, 0x1d, 0xc0003dde28, 0x1, 0x1) /data/algorithm/src/github.com/golang/glog/glog.go:655 +0x14d github.com/golang/glog.Fatalf(0x5556b4f613b8, 0x1d, 0xc0003dde28, 0x1, 0x1) /data/algorithm/src/github.com/golang/glog/glog.go:1148 +0x69 main.kernelMain(0xc000332108, 0x13, 0xc000334690) /data/algorithm/src/github.com/yunabe/lgo/cmd/lgo-internal/kernel.go:301 +0x200 main.main() /data/algorithm/src/github.com/yunabe/lgo/cmd/lgo-internal/main.go:206 +0x659 2019/04/23 10:32:17 lgo-internal failed: exit status 255

    opened by mullerhai 1
Owner
Yu Watanabe
Yu Watanabe
OpenAIOS is an incubating open-source distributed OS kernel based on Kubernetes for AI workloads

OpenAIOS is an incubating open-source distributed OS kernel based on Kubernetes for AI workloads. OpenAIOS-Platform is an AI development platform built upon OpenAIOS for enterprises to develop and deploy AI applications for production.

4Paradigm 80 Dec 9, 2022
Kernel - The design princinples of new moderinizing toolsets

Kernel the design principles of new modernizing toolsets Todo generate core mode

Modernizing 3 Apr 24, 2022
Cloudbase Solutions 1 Feb 17, 2022
Provides an interactive prompt to connect to ECS Containers using the ECS ExecuteCommand API.

ecsgo Heavily inspired by incredibly useful gossm, this tool makes use of the new ECS ExecuteCommand API to connect to running ECS tasks. It provides

Ed Smith 45 Dec 12, 2022
Interactive Cloud-Native Environment Client

Fenix-CLI:Interactive Cloud-Native Environment Client English | 简体中文 Fenix-CLI is an interactive cloud-native operating environment client. The goal i

IcyFenix 86 Dec 15, 2022
Book-API was made using Golang and PostgreSQL with technique CRUD with mux and pq

Book-API CRUD with PostgreSQL Table of contents ?? General info Technologies Blog Setup General info BAPI or Book-API is a Golang REST API made to sho

Hafizh 1 Feb 18, 2022
Metrics collector and ebpf-based profiler for C, C++, Golang, and Rust

Apache SkyWalking Rover SkyWalking Rover: Metrics collector and ebpf-based profiler for C, C++, Golang, and Rust. Documentation Official documentation

The Apache Software Foundation 103 Jan 6, 2023
Using the Golang search the Marvel Characters. This project is a web based golang application that shows the information of superheroes using Marvel api.

marvel-universe-web using the Golang search the Marvel Universe Characters About The Project This project is a web based golang application that shows

Burak KÖSE 2 Oct 10, 2021
Golang-tutorials - This repository contains golang tutorials right from basic to advanced.

Golang-tutorials This repository contains golang tutorials right from basic to advanced. Go is a statically typed, compiled programming language desig

Prayas Gautam 0 Jan 3, 2022
Golang-for-node-devs - Golang for Node.js developers

Golang for Node.js developers Who is this video for? Familiar with Node.js and i

TomDoesTech 6 Dec 7, 2022
Poc rsa - A simple golang scaffolding to help me to create new api projects or workers with golang on k8s

go-scaffold A simple golang scaffolding to help me to create new api projects or

André Luis 0 Feb 3, 2022
Golang-samples - Help someone need some practices when learning golang

GO Language Samples This project is to help someone need some practices when lea

Gui Chen 1 Jan 11, 2022
S3 Reverse Proxy with GET, PUT and DELETE methods and authentication (OpenID Connect and Basic Auth)

Menu Why ? Features Configuration Templates Open Policy Agent (OPA) API GET PUT DELETE AWS IAM Policy Grafana Dashboard Prometheus metrics Deployment

Havrileck Alexandre 154 Jan 2, 2023
GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

OVO Technology 601 Jan 2, 2023
The Oracle Database Operator for Kubernetes (a.k.a. OraOperator) helps developers, DBAs, DevOps and GitOps teams reduce the time and complexity of deploying and managing Oracle Databases

The Oracle Database Operator for Kubernetes (a.k.a. OraOperator) helps developers, DBAs, DevOps and GitOps teams reduce the time and complexity of deploying and managing Oracle Databases. It eliminates the dependency on a human operator or administrator for the majority of database operations.

Oracle 88 Dec 14, 2022
An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and send these alerts to developers in the form of SMS and emails.

Alert-System An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and sen

null 0 Dec 10, 2021
Deploy, manage, and secure applications and resources across multiple clusters using CloudFormation and Shipa

CloudFormation provider Deploy, secure, and manage applications across multiple clusters using CloudFormation and Shipa. Development environment setup

Shipa 1 Feb 12, 2022