Skip to content

Commit 9570fb7

Browse files
authored
Merge args linker path update (#131)
1 parent 2d3096d commit 9570fb7

File tree

44 files changed

+1698
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1698
-182
lines changed

.github/workflows/update-commands.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Check
2525
run: |
2626
if [[ `git status packages/gatsby-theme-iterative/config/prismjs --porcelain` ]]; then
27-
cml pr create packages/gatsby-theme-iterative/config/prismjs --title "Update tool commands" --message "update tool commands"
27+
cml comment update --pr packages/gatsby-theme-iterative/config/prismjs --title "Update tool commands" --message "update tool commands"
2828
else
2929
echo "No changes!"
3030
fi

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @iterative/websites

README.md

Lines changed: 6 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,8 @@
1-
# Gatsby Theme: Iterative
1+
# Gatsby Theme: Iterative development monorepo
22

3-
This Gatsby Theme houses the shared website code for all websites for
4-
[Iterative](https://iterative.ai). This package is currently purpose-built
5-
specifically for our websites and not very useful outside of them, but we intend
6-
to change that as we make improvements and iron out issues!
3+
This repo is dedicated to the development of `gatsby-theme-iterative`, a shared
4+
code bundle used between all the Gatsby websites hosted by
5+
[Iterative, inc](iterative.ai)!
76

8-
## Usage
9-
10-
### Options
11-
12-
- disable: boolean Default: Boolean(process.env.SKIP_DOCS)
13-
14-
- getTemplate: function Default: () => defaultGetTemplate
15-
16-
- defaultTemplate: string Default: require.resolve('./src/templates/doc.tsx')
17-
18-
- remark: boolean Default: true
19-
20-
- filesystem: boolean Default: true
21-
22-
- glossaryDirectory: string Default: 'docs/user-guide/basic-concepts'
23-
24-
- simpleLinkerTerms: { matches: string, url: string }[] These terms will be
25-
passed to the simpleLinker remark plugin
26-
27-
- cssBase: string Used as base files for global PostCSS variables and queries
28-
29-
- customMediaConfig: object config passed to `postcss-custom-media`
30-
31-
- customPropertiesConfig: object config passed to `postcss-custom-properties`
32-
33-
- colorModConfig: object config passed to `postcss-color-mod`
34-
35-
- postCssPlugins: Plugin[] If specified, this array will completely replace
36-
plugins this theme passes to PostCSS. This is mostly an escape hatch for if
37-
styles are broken with the default plugins. Check out
38-
[the theme's `gatsby-config`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/gatsby-theme-iterative/gatsby-config.js)
39-
to see the default plugins, as not having them in this option will very likely
40-
break core functionality.
41-
42-
### Examples
43-
44-
See this example from
45-
[the example website's `gatsby-config.js`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/example/gatsby-config.js).
46-
47-
```js
48-
const path = require('path')
49-
const {
50-
name: themePackageName
51-
} = require('../gatsby-theme-iterative/package.json')
52-
53-
module.exports = {
54-
trailingSlash: 'never',
55-
siteMetadata: {
56-
title: 'Example website',
57-
description: 'Example website description',
58-
keywords: ['docs', 'test'],
59-
siteUrl: 'http://localhost:8000'
60-
},
61-
plugins: [
62-
{
63-
resolve: themePackageName,
64-
options: {
65-
simpleLinkerTerms: require('./content/linked-terms')
66-
}
67-
},
68-
{
69-
resolve: 'gatsby-source-filesystem',
70-
options: {
71-
name: 'images',
72-
path: path.join(__dirname, 'static', 'img')
73-
}
74-
},
75-
'@sentry/gatsby'
76-
]
77-
}
78-
```
7+
For more details about the theme itself, check out its
8+
[README](packages/gatsby-theme-iterative/README.md)!

packages/example/content/docs/examples.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,14 @@ To push the changes upstream, run:
8585
git push origin cv-class#dev#1 #this is a comment
8686
#This is a comment
8787
```
88+
89+
## Highlight --options-with-hypthen
90+
91+
```cli
92+
$ cml runner launch \
93+
--cloud=aws \
94+
--cloud-region=us-west \
95+
--cloud-type=m+t4 \
96+
--cloud-permission-set=arn:aws:iam::1234567890:instance-profile/dvc-s3-access \
97+
--labels=cml-gpu
98+
```
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# annotate
2+
3+
Update artifact metadata annotations.
4+
5+
## Synopsis
6+
7+
```usage
8+
usage: gto annotate [-r <text>] [--type <text>] [--path <text>]
9+
[-e] [--label <text>] [-d <text>] [--commit]
10+
[--push] [-h]
11+
name
12+
13+
arguments:
14+
name Artifact name
15+
```
16+
17+
## Description
18+
19+
The command adds the artifact annotation to `artifacts.yaml` file. Feel free to
20+
modify the file directly!
21+
22+
For example,
23+
24+
```cli
25+
$ gto annotate awesome-model \
26+
--type model \
27+
--path models/neural_network.h5 \
28+
--label ml
29+
--label cool
30+
--description "This model is very cool"
31+
```
32+
33+
will create
34+
35+
```yaml
36+
awesome-model:
37+
description: This model is very cool
38+
labels:
39+
- ml
40+
- cool
41+
path: models/neural_network.h5
42+
type: model
43+
```
44+
45+
This information can be later retrieved by running `gto describe` command.
46+
47+
> Don't forget to commit `artifacts.yaml` with Git to associate it with the
48+
> latest artifact version and stage in any copy of the repo.
49+
50+
By default GTO saves artifact as `virtual`. Use the `--must_exist` flag to tell
51+
GTO the artifact file is committed to Git.
52+
53+
<details>
54+
55+
### Virtual vs. Physical artifacts
56+
57+
- Physical files/directories are committed to the repo. When you create a new
58+
version or assign a stage to it, Git guarantees that it's immutable -- you can
59+
return a year later and get the same artifact by providing a version.
60+
61+
- Virtual artifacts could be an external path (e.g. `s3://mybucket/myfile`) or a
62+
local path to a metafile representing an externally stored artifact file (as
63+
[with DVC](https://dvc.org/doc/start/data-management)). In this case, GTO
64+
can't pin versions to a physical state of the artifact and guarantee its
65+
immutability later, e.g. if `s3://mybucket/myfile` changes the registry won't
66+
know it, nor have a way to recover the original file.
67+
68+
> In future versions, we will support additional enrichments: useful information
69+
> that other tools like [DVC](https://dvc.org/) and [MLEM](https://mlem.ai/) can
70+
> provide about the artifacts. This will allow treating DVC repo outputs as
71+
> usual artifacts instead of `virtual` ones.
72+
73+
</details>
74+
75+
## Options
76+
77+
- `-r <text>`, `--repo <text>` - Local or remote repository [default: .]
78+
- `--type <text>` - Artifact type
79+
- `--path <text>` - Artifact path
80+
- `-e`, `--must-exist` - Verify artifact is committed to Git
81+
- `--label <text>` - Labels to add to artifact
82+
- `-d <text>`, `--description <text>` - Artifact description
83+
- `--commit` - Automatically commit changes due to this command (experimental)
84+
- `--push` - Push created commit automatically (experimental) - will set
85+
commit=True
86+
- `-h`, `--help` - Show this message and exit.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# assign
2+
3+
Assign stage to specific artifact version.
4+
5+
## Synopsis
6+
7+
```usage
8+
usage: gto assign [-r <text>] [--version <text>]
9+
[--stage <text>] [-m <text>]
10+
[--simple <text>] [--force] [--push] [--sr]
11+
[-h]
12+
name [ref]
13+
14+
arguments:
15+
name Artifact name
16+
[ref] Git reference to use
17+
```
18+
19+
## Description
20+
21+
To assign an actionable stage for a specific artifact version use the same
22+
`gto assign` command. Stages can mark the artifact readiness for a specific
23+
consumer. You can plug in a real downsteam system via CI/CD or web hooks, e.g.
24+
to redeploy an ML model.
25+
26+
```cli
27+
$ gto assign awesome-model --version v0.0.1 --stage prod
28+
Created git tag 'awesome-model#prod#1' that assigns stage to 'v0.0.1'
29+
```
30+
31+
GTO creates a special Git tag in
32+
[the standard format](/doc/gto/user-guide/git-tags).
33+
34+
## Options
35+
36+
- `-r <text>`, `--repo <text>` - Local or remote repository [default: .]
37+
- `--version <text>` - If you provide REF, this will be used to name new version
38+
- `--stage <text>` - Stage to assign
39+
- `-m <text>`, `--message <text>` - Message to annotate the Git tag with
40+
- `--simple <text>` - Use simple notation, e.g. `rf#prod` instead of `rf#prod-5`
41+
[supported values: auto, true, false] [default: auto]
42+
- `--force` - Create the Git tag even if it already exists and is in effect
43+
- `--push` - Push created tag automatically (experimental)
44+
- `--sr`, `--skip-registration` - Don't register a version at specified commit
45+
- `-h`, `--help` - Show this message and exit.
46+
47+
## Examples
48+
49+
Assign artifact "nn" to "prod" at specific Git ref instead of supplying artifact
50+
version (note that this will also register a version if it doesn't exist):
51+
52+
```cli
53+
$ gto assign nn abcd123 --stage prod
54+
```
55+
56+
Assign stage at specific Git ref and name the version explicitly (this assumes
57+
that version was not registered yet):
58+
59+
```cli
60+
$ gto assign nn abcd123 --version v1.0.0 --stage prod
61+
```
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# check-ref
2+
3+
Find out the artifact version registered/assigned with ref.
4+
5+
## Synopsis
6+
7+
```usage
8+
usage: gto check-ref [-r <text>] [--json] [--name] [--version]
9+
[--event] [--stage] [-h]
10+
ref
11+
12+
arguments:
13+
ref Git reference to analyze
14+
```
15+
16+
## Description
17+
18+
You can use `gto check-ref` to interpret a Git tag:
19+
20+
```cli
21+
$ gto check-ref -r build/example-gto churn#prod#3
22+
✅ Stage "prod" was assigned to version "v3.0.0" of artifact "churn"
23+
```
24+
25+
For machine-consumable format, use `--json` flag or output specific pieces of
26+
information with `--name`, `--version`, `--stage` or `--event`.
27+
28+
## Options
29+
30+
- `-r <text>`, `--repo <text>` - Local or remote repository [default: .]
31+
- `--json` - Print output in json format
32+
- `--name` - Show artifact name
33+
- `--version` - Output artifact version
34+
- `--event` - Show event
35+
- `--stage` - Show artifact stage
36+
- `-h`, `--help` - Show this message and exit.

0 commit comments

Comments
 (0)