Skip to content

Commit

Permalink
Merge branch 'main' into default_keys
Browse files Browse the repository at this point in the history
TimoEg committed Jun 17, 2024
2 parents 2dfc7bb + ffe7f54 commit b5dafff
Showing 14 changed files with 360 additions and 242 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -9,10 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Added git remote repositories and directories as potential sources for config files in the cli.
* `title` and `description` can be set from `pretty` and `description` keys at root.


### Changed

* Moved `title` and `description` from `anyOf` to outside of schema. `anyOf` is now usable as intended for json schema.


### Removed

* Removed `title` and `description` support from `anyOf`.


## [0.3.0] - 2024-06-04

25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ Commands:
Options are dynamically created with the schema part of the config file.

> [!TIP]
> Show help for a config file with: `ibi show CONFIG_FILE --help`.
> Show help for a config file with: `ibi show CONFIG_FILE/FOLDER/GIT_REPO_URL --help`.

## Config
@@ -86,7 +86,28 @@ Options are dynamically created with the schema part of the config file.
* When creating a schema use the following schema draft version: https://json-schema.org/draft/2020-12/schema
* `title` are used for pretty print option names.
* `description` is used for the options help message.
* `anyOf` with nested `const` and `title` are a special case as a replacement for `enum` but with pretty print name.
* For adding a description and a pretty print name to enum values (for [web-installation-instruction](https://github.com/instructions-d-installation/web-installation-instruction)):
1. Indent the schema with the key `schema`.
2. Add `pretty` and `description` keys.
3. Create lists like `key: Pretty Key`.
* `title` and `description` from within the schema overwrite `pretty` and `description` outside of the schema.

```yaml
schema:
name: installation-instruction
type: object
properties:
method:
enum:
- pipx
- pip
pretty:
pipx: Pipx
pip: Pip
description:
pipx: Installs python packages into virtual environments.
pip: Standard python package manager.
```
### Template
113 changes: 58 additions & 55 deletions examples/pytorch/pytorch-instruction.schema.yml.jinja
Original file line number Diff line number Diff line change
@@ -1,58 +1,61 @@
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://github.com/instructions-d-installation/installation-instruction/examples/pytorch/instruction_pytorch.schema.yml
title: PyTorch Install Schema
description: This is a schema which is used for constructing interactive installation instructions.
type: object
$comment: by Adam McKellar
properties:
build:
title: Build
description: Use the latest or the tested version.
anyOf:
- title: Stable (2.3.0)
const: stable
- title: Preview (Nightly)
const: preview
default: stable
os:
title: Operating System
description: The operating system you use.
anyOf:
- title: Linux
const: linux
- title: Mac
const: mac
- title: Windows
const: win
default: win
package:
title: Package Manager
description: The package manager you use.
anyOf:
- title: Conda
const: conda
- title: Pip
const: pip
default: pip
compute_platform:
title: Compute Platform
description: Should your gpu or your cpu handle the task?
anyOf:
- title: CUDA 11.8
const: cu118
- title: CUDA 12.1
const: cu121
- title: ROCm 6.0
const: ro60
- title: CPU
const: cpu
default: cu118
required:
- build
- os
- package
- compute_platform
additionalProperties: false
schema:
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://github.com/instructions-d-installation/installation-instruction/examples/pytorch/instruction_pytorch.schema.yml
title: PyTorch Install Schema
description: This is a schema which is used for constructing interactive installation instructions.
type: object
$comment: by Adam McKellar
properties:
build:
title: Build
description: Use the latest or the tested version.
enum:
- stable
- preview
default: stable
os:
title: Operating System
description: The operating system you use.
enum:
- linux
- mac
- win
default: win
package:
title: Package Manager
description: The package manager you use.
enum:
- conda
- pip
default: pip
compute_platform:
title: Compute Platform
description: Should your gpu or your cpu handle the task?
enum:
- cu118
- cu121
- ro60
- cpu
default: cu118
required:
- build
- os
- package
- compute_platform
additionalProperties: false

pretty:
stable: Stable (2.3.0)
preview: Preview (Nightly)
linux: Linux
mac: Mac
win: Windows
conda: Conda
pip: Pip
cu118: CUDA 11.8
cu121: CUDA 12.1
ro60: ROCm 6.0
cpu: CPU

------

171 changes: 86 additions & 85 deletions examples/spacy/spacy-instruction.schema.yml.jinja
Original file line number Diff line number Diff line change
@@ -1,93 +1,94 @@
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://github.com/instructions-d-installation/installation-instruction/examples/spacy/schema_spacy.yml
title: Spacy Install Schema
description: This is a schema which is used for constructing interactive installation instructions.
type: object
$comment: by Kanushka Gupta
properties:
os:
title: Operating System
description: Specify your Operating System
anyOf:
- title: macOs/OSX
const: mac
- title: Windows
const: windows
- title: Linux
const: linux
default: windows
platform:
title: Platform
description: platform
anyOf:
- title: x86
const: x86
- title: ARM/M1
const: arm
default: x86
package:
title: Package Manager
description: The package manager you use.
anyOf:
- title: Conda
const: conda
- title: Pip
const: pip
- title: from source
const: source
default: pip
hardware:
title: Hardware
description: Hardware you want to use- CPU or GPU?
anyOf:
- title: CPU
const: cpu
- title: GPU
const: gpu
type: string
default: cpu

configuration:
title: Configuration
description: the configuration you have
anyOf:
- title: virtual env
const: venv
- title: train models
const: train_models
pipeline:
anyOf:
- title: efficiency
const: efficiency
- title: accuracy
const: accuracy
if:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://github.com/instructions-d-installation/installation-instruction/examples/spacy/schema_spacy.yml
title: Spacy Install Schema
description: This is a schema which is used for constructing interactive installation instructions.
type: object
$comment: by Kanushka Gupta
properties:
os:
title: Operating System
description: Specify your Operating System
enum:
- mac
- windows
- linux
default: windows
platform:
title: Platform
description: platform
enum:
- x86
- arm
default: x86
package:
title: Package Manager
description: The package manager you use.
enum:
- conda
- pip
- source
default: pip
hardware:
const: gpu
then:
properties:
cuda_runtime:
title: Hardware
description: Hardware you want to use- CPU or GPU?
enum:
- CUDA 8.0
- CUDA 9.0
- CUDA 9.1
- CUDA 9.2
- CUDA 10.0
- CUDA 10.1
- CUDA 10.2
- CUDA 11.0
- CUDA 11.1
- CUDA 11.2 - 11.x
- CUDA 12.x
- cpu
- gpu
type: string
default: cpu

required:
- os
- platform
- package
- hardware
additionalProperties: false
configuration:
title: Configuration
description: the configuration you have
enum:
- venv
- train_models
pipeline:
enum:
- efficiency
- accuracy
if:
properties:
hardware:
const: gpu
then:
properties:
cuda_runtime:
enum:
- CUDA 8.0
- CUDA 9.0
- CUDA 9.1
- CUDA 9.2
- CUDA 10.0
- CUDA 10.1
- CUDA 10.2
- CUDA 11.0
- CUDA 11.1
- CUDA 11.2 - 11.x
- CUDA 12.x

required:
- os
- platform
- package
- hardware
additionalProperties: false

pretty:
mac: macOs/OSX
windows: Windows
linux: Linux
x86: x86
arm: ARM/M1
pip: Pip
conda: Conda
cpu: CPU
gpu: GPU
venv: virtual env
train_models: train models
efficiency: efficiency
accuracy: accuracy

------

Loading

0 comments on commit b5dafff

Please sign in to comment.