Skip to content

Commit

Permalink
feat: add typos to pre-commit and GitHub action (#1493)
Browse files Browse the repository at this point in the history
* feat: add typos to pre-commit and GitHub action

Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>

* fix: fix existing typos

Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>

* chore: add reference

Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>

---------

Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
  • Loading branch information
hezhizhen committed Feb 20, 2023
1 parent 6bf7d5b commit dc57256
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 16 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ concurrency:
cancel-in-progress: true

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling with custom config file
uses: crate-ci/typos@v1.13.10
with:
config: ./typos.toml
lint:
name: lint
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ repos:
hooks:
- id: golangci-lint
args: [--config=.golangci.yml, --timeout=3m]
- repo: https://github.com/crate-ci/typos
rev: v1.13.10
hooks:
- id: typos
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<a href="https://twitter.com/TensorChord"><img src="https://img.shields.io/twitter/follow/tensorchord?style=social" alt="trackgit-views" /></a>
<a href="https://pypi.org/project/envd"><img src="https://img.shields.io/pypi/pyversions/envd" alt="Python Version" /></a>
<a href="https://github.com/tensorchord/envd#contributors-"><img alt="all-contributors" src="https://img.shields.io/github/all-contributors/tensorchord/envd/main"></a>
<a href="https://pypi.org/project/envd/"><img alt="envd package donwloads" src="https://static.pepy.tech/personalized-badge/envd?period=month&units=international_system&left_color=grey&right_color=brightgreen&left_text=downloads/month"</a>
<a href="https://pypi.org/project/envd/"><img alt="envd package downloads" src="https://static.pepy.tech/personalized-badge/envd?period=month&units=international_system&left_color=grey&right_color=brightgreen&left_text=downloads/month"</a>
<a href="https://github.com/tensorchord/envd/actions/workflows/CI.yml"><img alt="continuous integration" src="https://github.com/tensorchord/envd/actions/workflows/CI.yml/badge.svg"></a>
<a href='https://coveralls.io/github/tensorchord/envd?branch=main'><img src='https://coveralls.io/repos/github/tensorchord/envd/badge.svg?branch=main' alt='Coverage Status' /></a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/images/after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/images/before.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions docs/proposals/20220826-image-runtime-redistributed-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Authors:

## Summary

The `envd` would add (runing graph metadata)[https://github.com/tensorchord/envd/blob/630ada172bdf876c3b749329fdbe284c108051f2/pkg/lang/ir/types.go#L70] would be encoded into a ASCII string and added to be image(OCI Spec) as a config.
The `envd` would add (running graph metadata)[https://github.com/tensorchord/envd/blob/630ada172bdf876c3b749329fdbe284c108051f2/pkg/lang/ir/types.go#L70] would be encoded into a ASCII string and added to be image(OCI Spec) as a config.

we named the above mentioned encoded config `Envd Runtime Graph Label`

## Motivation

This proposal is part of effort to define what the artifact `envd` delivery and decoupling the phases of build and runing. It will be friendly for running a envd environment even at the absence of `build.env`.
This proposal is part of effort to define what the artifact `envd` delivery and decoupling the phases of build and running. It will be friendly for running a envd environment even at the absence of `build.env`.

the concept of `running context` is a also needed as addition of `build contxt` for example:
the concept of `running context` is a also needed as addition of `build context` for example:

- An engineer build a easy-to-use env for his/her interns for the quick use of company tools.
- Kubernetes remote runtime support in the future.
Expand All @@ -26,12 +26,12 @@ the concept of `running context` is a also needed as addition of `build contxt`
## Implementations

There are two parts of runtime configuration that can be used in envd.
- OCI sepecifications specific:
- OCI specifications specific:
- ExposedPort
- Entrypoint
- Env
- Cmd
- Custome Labels
- Custom Labels

For some parts of runtime configuration, we could use the OCI part such as environment variables. We still need to deal with extra parts such as port bindings which not covered by the OCI spec.

Expand All @@ -51,4 +51,4 @@ we use the following labels:

- ai.tensorchord.envd.runtimeGraph.version
- ai.tensorchord.envd.runtimeGraph.Daemon
- ai.tensorchord.envd.runtimeGraph.Expose
- ai.tensorchord.envd.runtimeGraph.Expose
2 changes: 1 addition & 1 deletion envd/api/v1/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def repo(url: str, description: str):


def owner(uid: int, gid: int):
"""Configure uid:gid as the environmen owner.
"""Configure uid:gid as the environment owner.
This can also be achieved by using flag `envd --owner uid:gid build` or environment
variable `ENVD_BUILD_OWNER=uid:gid envd build`
Expand Down
2 changes: 1 addition & 1 deletion examples/stable-diffusion/build.envd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def build():
"diffusers",
]
)
# if you need run in cuda enviroment, you can add this line below, change cuda and cudnn version to your owner
# if you need run in cuda environment, you can add this line below, change cuda and cudnn version to your owner
install.cuda(version="11.2.2", cudnn="8")
runtime.mount(
host_path="~/.cache/huggingface", envd_path="/home/envd/.cache/huggingface"
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

var _ = Describe("docker", func() {
When("given the a lowcase tag", func() {
When("given the a lowercase tag", func() {
It("should return the tag identically", func() {
tag := "test:test"
newTag, err := NormalizeName(tag)
Expand Down
2 changes: 1 addition & 1 deletion pkg/lang/frontend/starlark/v0/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (s *generalInterpreter) loadGitModule(thread *starlark.Thread, path string)
}

func (s generalInterpreter) ExecFile(filename string, funcname string) (interface{}, error) {
logrus.WithField("filename", filename).Debug("interprete the file")
logrus.WithField("filename", filename).Debug("interpret the file")
thread := s.NewThread(filename)
globals, err := s.exec(thread, filename)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/lang/frontend/starlark/v1/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (s *generalInterpreter) loadGitModule(thread *starlark.Thread, path string)
}

func (s generalInterpreter) ExecFile(filename string, funcname string) (interface{}, error) {
logrus.WithField("filename", filename).Debug("interprete the file")
logrus.WithField("filename", filename).Debug("interpret the file")
thread := s.NewThread(filename)
globals, err := s.exec(thread, filename)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/lang/ir/v0/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (g generalGraph) installHorust(root llb.State) llb.State {
File(llb.Mkdir(types.HorustLogDir, 0777, llb.WithParents(true)),
llb.WithCustomNamef("[internal] mkdir for horust log: %s", types.HorustLogDir)).
Run(llb.Shlexf(`sudo chmod 777 %s`, types.HorustLogDir),
llb.WithCustomName("[internal] change dirctory permission for logging"))
llb.WithCustomName("[internal] change directory permission for logging"))

return horust.Root()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/lang/ir/v1/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (g generalGraph) installHorust(root llb.State) llb.State {
File(llb.Mkdir(types.HorustLogDir, 0777, llb.WithParents(true)),
llb.WithCustomNamef("[internal] mkdir for horust log: %s", types.HorustLogDir)).
Run(llb.Shlexf(`sudo chmod 777 %s`, types.HorustLogDir),
llb.WithCustomName("[internal] change dirctory permission for logging"))
llb.WithCustomName("[internal] change directory permission for logging"))

return horust.Root()
}
Expand Down
5 changes: 5 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
[files]
extend-exclude = ["CHANGELOG.md"]
[default.extend-words]
iterm = "iterm"

0 comments on commit dc57256

Please sign in to comment.