Skip to content

Commit

Permalink
chore: Rename project to envd (#135)
Browse files Browse the repository at this point in the history
* chore: Rename

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: rename

Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege authored May 11, 2022
1 parent af02d93 commit 8068f91
Show file tree
Hide file tree
Showing 61 changed files with 211 additions and 225 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/MIDI
working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/envd
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/tensorchord/MIDI
path: ${{ env.GOPATH }}/src/github.com/tensorchord/envd
- name: Setup Go
uses: actions/setup-go@v2
with:
Expand All @@ -75,7 +75,7 @@ jobs:
# uses: shogo82148/actions-goveralls@v1
# with:
# path-to-profile: coverage.out
# working-directory: src/github.com/tensorchord/MIDI
# working-directory: src/github.com/tensorchord/envd
# flag-name: unit-test
# parallel: true
build:
Expand All @@ -85,13 +85,13 @@ jobs:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/MIDI
working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/envd

steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/tensorchord/MIDI
path: ${{ env.GOPATH }}/src/github.com/tensorchord/envd
- name: Setup Go
uses: actions/setup-go@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ go.work
__debug_bin
bin/
debug-bin/
/build.MIDI
/build.envd
.ipynb_checkpoints/
cover.html

Expand Down
46 changes: 23 additions & 23 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ builds:
- CGO_ENABLED=0
goos:
- linux
id: midi
main: ./cmd/midi
binary: midi
id: envd
main: ./cmd/envd
binary: envd
ldflags:
- -s -w
- -X github.com/tensorchord/MIDI/pkg/version.Version={{ .Version }}
- -X github.com/tensorchord/MIDI/pkg/version.Revision={{ .Commit }}
- -X github.com/tensorchord/envd/pkg/version.Version={{ .Version }}
- -X github.com/tensorchord/envd/pkg/version.Revision={{ .Commit }}
- env:
- CGO_ENABLED=0
goos:
- linux
id: midi-ssh
main: ./cmd/midi-ssh
binary: midi-ssh
id: envd-ssh
main: ./cmd/envd-ssh
binary: envd-ssh
ldflags:
- -s -w
- -X github.com/tensorchord/MIDI/pkg/version.Version={{ .Version }}
- -X github.com/tensorchord/MIDI/pkg/version.Revision={{ .Commit }}
- -X github.com/tensorchord/envd/pkg/version.Version={{ .Version }}
- -X github.com/tensorchord/envd/pkg/version.Revision={{ .Commit }}
archives:
- id: midi
- id: envd
format: binary
builds:
- midi
- envd
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
- id: midi-ssh
- id: envd-ssh
format: binary
builds:
- midi-ssh
- envd-ssh
replacements:
darwin: Darwin
linux: Linux
Expand All @@ -59,24 +59,24 @@ changelog:
- '^test:'
dockers:
- image_templates:
- "ghcr.io/tensorchord/midi-ssh-from-scratch:{{ .Version }}-amd64"
- "ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-amd64"
use: buildx
dockerfile: .goreleaser/midi-ssh.Dockerfile
dockerfile: .goreleaser/envd-ssh.Dockerfile
ids:
- midi-ssh
- envd-ssh
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/tensorchord/midi-ssh-from-scratch:{{ .Version }}-arm64v8"
- "ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-arm64v8"
use: buildx
goarch: arm64
ids:
- midi-ssh
dockerfile: .goreleaser/midi-ssh.Dockerfile
- envd-ssh
dockerfile: .goreleaser/envd-ssh.Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
docker_manifests:
- name_template: ghcr.io/tensorchord/midi-ssh-from-scratch:{{ .Version }}
- name_template: ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}
image_templates:
- ghcr.io/tensorchord/midi-ssh-from-scratch:{{ .Version }}-amd64
- ghcr.io/tensorchord/midi-ssh-from-scratch:{{ .Version }}-arm64v8
- ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-amd64
- ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-arm64v8
2 changes: 2 additions & 0 deletions .goreleaser/envd-ssh.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM scratch
COPY envd-ssh /usr/bin/envd-ssh
2 changes: 0 additions & 2 deletions .goreleaser/midi-ssh.Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Please refer to the [CNCF Community Code of Conduct v1.0](https://github.com/cnc
```
go mod tidy
make
./bin/midi bootstrap
./bin/midi --version
./bin/envd bootstrap
./bin/envd --version
```

### Lint
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MIDI Authors.
# Copyright 2022 envd Authors.
#
# The old school Makefile, following are required targets. The Makefile is written
# to allow building multiple binaries. You are free to add more targets or change
Expand Down Expand Up @@ -26,10 +26,10 @@
#

# This repo's root import path (under GOPATH).
ROOT := github.com/tensorchord/MIDI
ROOT := github.com/tensorchord/envd

# Target binaries. You can build multiple binaries for a single project.
TARGETS := midi midi-ssh
TARGETS := envd envd-ssh

# Container image prefix and suffix added to targets.
# The final built images are:
Expand Down Expand Up @@ -129,7 +129,7 @@ debug-local:
done

addlicense:
addlicense -c "The MIDI Authors" **/*.go **/**/*.go **/**/**/*.go
addlicense -c "The envd Authors" **/*.go **/**/*.go **/**/**/*.go

test: generate
@go test -race -coverprofile=coverage.out ./...
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MIDI
# envd

Development Environment for Data Scientists

Expand All @@ -21,21 +21,21 @@ Development Environment for Data Scientists
### From binary

```bash
sudo /bin/sh -c 'wget https://github.com/tensorchord/midi/releases/download/0.0.1-alpha.3/midi_0.0.1-alpha.3_Linux_x86_64 -O /usr/local/bin/midi && chmod +x /usr/local/bin/midi && /usr/local/bin/midi bootstrap'
sudo /bin/sh -c 'wget https://github.com/tensorchord/envd/releases/download/0.0.1-alpha.3/envd_0.0.1-alpha.3_Linux_x86_64 -O /usr/local/bin/envd && chmod +x /usr/local/bin/envd && /usr/local/bin/envd bootstrap'
```

### From source code

```bash
git clone https://github.com/tensorchord/midi
git clone https://github.com/tensorchord/envd
go mod tidy
make
./bin/midi --version
./bin/envd --version
```

## Quickstart

Checkout the [examples](./examples/mnist), and configure MIDI with the manifest `build.MIDI`:
Checkout the [examples](./examples/mnist), and configure envd with the manifest `build.envd`:

```python
vscode(plugins=[
Expand All @@ -52,7 +52,7 @@ shell("zsh")
jupyter(password="", port=8888)
```

Then you can run `midi up` and open jupyter notebook at [`http://localhost:8888`](http://localhost:8888), or open vscode remote to attach to the container.
Then you can run `envd up` and open jupyter notebook at [`http://localhost:8888`](http://localhost:8888), or open vscode remote to attach to the container.

```
[+] ⌚ parse build.MIDI and download/cache dependencies 0.0s ✅ (finished)
Expand All @@ -77,7 +77,7 @@ MIDI >
### Configure mirrors

```
cat ~/.config/midi/config.MIDI
cat ~/.config/envd/config.envd
ubuntu_apt(source="""
deb https://mirror.sjtu.edu.cn/ubuntu focal main restricted
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates main restricted
Expand Down
8 changes: 0 additions & 8 deletions build.MIDI

This file was deleted.

14 changes: 7 additions & 7 deletions cmd/midi-ssh/main.go → cmd/envd-ssh/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The MIDI Authors
// Copyright 2022 The envd Authors
// Copyright 2022 The okteto remote Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -26,13 +26,13 @@ import (
"github.com/sirupsen/logrus"
cli "github.com/urfave/cli/v2"

"github.com/tensorchord/MIDI/pkg/remote/sshd"
"github.com/tensorchord/MIDI/pkg/version"
"github.com/tensorchord/envd/pkg/remote/sshd"
"github.com/tensorchord/envd/pkg/version"
)

const (
authorizedKeysPath = "/var/midi/remote/authorized_keys"
envPort = "MIDI_SSH_PORT"
authorizedKeysPath = "/var/envd/remote/authorized_keys"
envPort = "envd_SSH_PORT"
flagDebug = "debug"
flagAuthKey = "authorized-keys"
flagNoAuth = "no-auth"
Expand All @@ -44,8 +44,8 @@ func main() {
}

app := cli.NewApp()
app.Name = "midi-ssh"
app.Usage = "ssh server for MIDI"
app.Name = "envd-ssh"
app.Usage = "ssh server for envd"
app.Version = version.Version
app.Flags = []cli.Flag{
&cli.BoolFlag{
Expand Down
11 changes: 5 additions & 6 deletions cmd/midi/bootstrap.go → cmd/envd/bootstrap.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2022 The MIDI Authors
// Copyright 2022 The midi Authors
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,13 +18,13 @@ import (
"github.com/sirupsen/logrus"
cli "github.com/urfave/cli/v2"

ac "github.com/tensorchord/MIDI/pkg/autocomplete"
"github.com/tensorchord/MIDI/pkg/buildkitd"
ac "github.com/tensorchord/envd/pkg/autocomplete"
"github.com/tensorchord/envd/pkg/buildkitd"
)

var CommandBootstrap = &cli.Command{
Name: "bootstrap",
Usage: "Bootstraps midi installation including shell autocompletion and buildkit image download",
Usage: "Bootstraps envd installation including shell autocompletion and buildkit image download",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "buildkit",
Expand All @@ -35,7 +34,7 @@ var CommandBootstrap = &cli.Command{
},
&cli.BoolFlag{
Name: "with-autocomplete",
Usage: "Add midi autocompletions",
Usage: "Add envd autocompletions",
Value: true,
},
},
Expand Down
14 changes: 7 additions & 7 deletions cmd/midi/build.go → cmd/envd/build.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The MIDI Authors
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -20,26 +20,26 @@ import (
"github.com/cockroachdb/errors"
cli "github.com/urfave/cli/v2"

"github.com/tensorchord/MIDI/pkg/builder"
"github.com/tensorchord/MIDI/pkg/home"
"github.com/tensorchord/envd/pkg/builder"
"github.com/tensorchord/envd/pkg/home"
)

var CommandBuild = &cli.Command{
Name: "build",
Aliases: []string{"b"},
Usage: "build MIDI environment",
Usage: "build envd environment",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tag",
Usage: "Name and optionally a tag in the 'name:tag' format",
Aliases: []string{"t"},
Value: "midi:dev",
Value: "envd:dev",
},
&cli.PathFlag{
Name: "file",
Usage: "Name of the build.MIDI (Default is 'PATH/build.MIDI')",
Usage: "Name of the build.envd (Default is 'PATH/build.envd')",
Aliases: []string{"f"},
Value: "./build.MIDI",
Value: "./build.envd",
},
},

Expand Down
12 changes: 6 additions & 6 deletions cmd/midi/destroy.go → cmd/envd/destroy.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The MIDI Authors
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,13 +19,13 @@ import (
"github.com/sirupsen/logrus"
cli "github.com/urfave/cli/v2"

"github.com/tensorchord/MIDI/pkg/docker"
"github.com/tensorchord/envd/pkg/docker"
)

var CommandDestroy = &cli.Command{
Name: "destroy",
Aliases: []string{"d"},
Usage: "destroys the MIDI environment",
Usage: "destroys the envd environment",
Flags: []cli.Flag{},

Action: destroy,
Expand All @@ -36,9 +36,9 @@ func destroy(clicontext *cli.Context) error {
if err != nil {
return err
}
if err := dockerClient.Destroy(clicontext.Context, "midi"); err != nil {
return errors.Wrap(err, "failed to destroy the midi environment")
if err := dockerClient.Destroy(clicontext.Context, "envd"); err != nil {
return errors.Wrap(err, "failed to destroy the envd environment")
}
logrus.Info("MIDI environment destroyed")
logrus.Info("envd environment destroyed")
return nil
}
Loading

0 comments on commit 8068f91

Please sign in to comment.