-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feasibility-research(lang): Refactor frontend language #91
Comments
Maybe we can support on-the-fly build like this import midi
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
midi.pip_package(name=["tensorflow", "numpy"])
"""
## Prepare the data
"""
# Model / data parameters
num_classes = 10
input_shape = (28, 28, 1) |
There are two papers/projects that @VoVAllen recommends reading: |
Autodetect: |
https://github.com/maxmcd/bramble Purely functional build system and package manager based on Nix We can refer to this project to implement some minimal primitives in Golang, then write starlark logic to provide built-in funcs. Now we write too many go funcs. And users need to write golang to extend the envd language.
|
Runtime Lang DesignExplicit call runtime running program def jupyter(port):
# Will add this as subprocess to PID 1
cmd("jupyter --port={}".format(port)).redirect(stdout=file("stdout.log"), stderr=endpoint("http://api.tensorchord.ai/record_err"))
def launch_ssh():
# launch ssh
cmd("/var/midi-ssh")
def run_train():
# Means the PID 1 will monitor this process, exit when this process failed
cmd("python train.py").main_program()
def run():
jupyter(port=8888)
launch_ssh()
run_train() Then |
We may provide some primitives to play with buildkit in Go, then use these primitives to write logic in starlark. Like: def base(os, language):
_base_img= Image("ubuntu:20.04")
# Execute command over base
install_htop = _base_img.run("sudo apt install htop")
# as llb merge, create a new state as base the base image
_base.image = _base.merge([install_htop, ...])
# Later step will use _base.image as the base |
LLB Primitives we used in current ir package:
LLB state operations:
|
Some random thoughts about frontend language def build():
base(os="ubuntu20.04", language="julia")
config.julia_pkg_server(url="https://mirrors.tuna.tsinghua.edu.cn/julia")
install.julia_packages([
"Example"
])
service.jupyter()
service.ssh()
service.new(name="tensorboard", command="tensorboard --logdir=logs")
system.copy(src="example.ipynb", dst="notebooks/example.ipynb")
vcs.git(remote="https://github.com/tensorchord/envd", branch="master", path="envd")
data.dvc(remote="https://remote.dvc.org", path="data")
data.s3(bucket="tensorchord-data", path="data") The dev config (ssh, cwd mount) can be wrapped into def build():
base(os="ubuntu20.04", language="julia")
preset()
def serving():
base(os="ubuntu20.04", language="python", image="python:3.8")
...
def preset():
service.jupyter()
service.ssh()
system.mount(cwd, "/home/envd") |
The design of Pros
Cons
|
The interface will look like:
|
Description
priority/high
The text was updated successfully, but these errors were encountered: