Skip to content
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

WIP: publishing metadata document schema #318

Merged
merged 22 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions schema/deploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
// URL to the schema definition, which we should make public.
"$schema": "./posit-publishing-schema-v3.json",

// Defines what we are deploying
"type": "quarto-static",
"entrypoint": "report.qmd",

// These metadata fields are purely for human consumption.
"title": "Regional Quarterly Sales Report",
"description": "This is the quarterly sales report, broken down by region.",
"thumbnail": "images/thumbnail.jpg",
"author": {
"name": "Michael Marchetti",
"email": "[email protected]",
"username": "mmarchetti",
"organization": "Posit, PBC"
},
// Arbitrary string tags. On Connect, only admins can create tags,
// and tags can be nested (e.g. "sales,reports,quarterly" is a
// single tag 3 levels deep in the tag tree). The example below
// is 3 separate top level tags.
"tags": [
"sales",
"quarterly",
"regional"
],
// List of (relative) file paths. If constructing a bundle to upload,
// these files must be included. For git deployments, the server
// will expect (required) that these files be present in the repo.
// Unlike manifest v1, there are no checksums, since those require
// updating this file whenever other files change, and we'd prefer
// to write this once and commit it.
"files": [
"report.qmd",
"_quarto.yml",
"model.py",
"requirements.txt",
"weights/sales-model.hdf5"
],
"dependencies": {
"python": {
"version": "3.11.3",
"package_file": "requirements.txt",
"package_manager": "pip"
},
"r": {
"version": "4.3.1",
"package_file": "renv.lock",
"package_manager": "renv"
},
"quarto": {
"version": "1.4"
}
},
"environment": {
"API_URL": "https://example.com/api",
// secret value, will be pulled from the environment when deploying through CLI,
// must be set at the server if deploying through git.
"API_KEY": null
},
"schedule": {
// Only valid for reports, not for apps.
// iCalendar spec: https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html
"start": "2023-10-25T08:00:00Z",
"recurrence": "FREQ=MONTHLY;INTERVAL=3"
},
"access": {
"users": [
{
// Password auth uses usernames as unique IDs.
// You can specify the auth provider unique ID,
// Connect-assigned GUID, or both. Tools
// should populate both, because GUIDs are not
// portable across Connect instances.
"id": "jqpublic",
"guid": "536b456e-0311-4f92-ba10-dbf1db8a468e",
"name": "John Q. Public",
"permissions": "editor"
}
],
"groups": [
{
// Connect identifies groups with a name and a GUID,
// both of which are unique. LDAP may provide
// a CN/DN as the unique ID, with a separate name. Tools
// should populate both, because GUIDs are not
// portable across Connect instances.
"id": "Data Science Team",
"guid": "8b4fde3e-f995-4894-bc02-ae47538262ff",
"name": "Data Science Team",
"permissions": "editor"
}
]
},
"connect": {
// These settings are Connect-specific and will be ignored by other servers.
"access": {
"run_as": "rstudio-connect",
"run_as_current_user": false
},
"runtime": {
// Might some of these apply beyond Connect? For example, init_timeout
// tells the server how long this app might take to start up.
"connection_timeout": 5,
"read_timeout": 30,
"init_timeout": 60,
"idle_timeout": 120,
"max_processes": 5,
"min_processes": 1,
"max_conns_per_process": 50,
"load_factor": 0.5
},
"kubernetes": {
// Will Posit Cloud Connect be containerized? If so, will it support
// image_name, cpu_limit, memory_limit, and/or gpu settings?
// (note k8s GPU settings are different from the docker ones)
"amd_gpu_limit": 0,
"cpu_limit": 1,
"cpu_request": 0.5,
"image_name": "posit/connect-runtime-python3.11-r4.3",
"memory_limit": "100000000",
"memory_request": "20000000",
"nvidia_gpu_limit": 0,
"service_account_name": "posit-connect-content",
"r_environment_management": true,
"py_environment_management": true
}
}
}
78 changes: 78 additions & 0 deletions schema/deploy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"$schema" = "./posit-publishing-schema-v3.json"
type = "quarto-static"
entrypoint = "report.qmd"
title = "Regional Quarterly Sales Report"
description = "This is the quarterly sales report, broken down by region."
thumbnail = "images/thumbnail.jpg"
tags = [ "sales", "quarterly", "regional" ]
files = [
"report.qmd",
"_quarto.yml",
"model.py",
"requirements.txt",
"weights/sales-model.hdf5"
]

[author]
name = "Michael Marchetti"
email = "[email protected]"
username = "mmarchetti"
organization = "Posit, PBC"

[dependencies.python]
version = "3.11.3"
package_file = "requirements.txt"
package_manager = "pip"

[dependencies.r]
version = "4.3.1"
package_file = "renv.lock"
package_manager = "renv"

[dependencies.quarto]
version = "1.4"

[environment]
API_URL = "https://example.com/api"

[schedule]
start = "2023-10-25T08:00:00Z"
recurrence = "FREQ=MONTHLY;INTERVAL=3"

[[access.users]]
id = "jqpublic"
guid = "536b456e-0311-4f92-ba10-dbf1db8a468e"
name = "John Q. Public"
permissions = "editor"

[[access.groups]]
id = "Data Science Team"
guid = "8b4fde3e-f995-4894-bc02-ae47538262ff"
name = "Data Science Team"
permissions = "editor"

[connect.access]
run_as = "rstudio-connect"
run_as_current_user = false

[connect.runtime]
connection_timeout = 5
read_timeout = 30
init_timeout = 60
idle_timeout = 120
max_processes = 5
min_processes = 1
max_conns_per_process = 50
load_factor = 0.5

[connect.kubernetes]
amd_gpu_limit = 0
cpu_limit = 1
cpu_request = 0.5
image_name = "posit/connect-runtime-python3.11-r4.3"
memory_limit = "100000000"
memory_request = "20000000"
nvidia_gpu_limit = 0
service_account_name = "posit-connect-content"
r_environment_management = true
py_environment_management = true
74 changes: 74 additions & 0 deletions schema/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# yaml-language-server: $schema=./posit-publishing-schema-v3.json
"$schema": "./posit-publishing-schema-v3.json"
type: quarto-static
entrypoint: report.qmd
title: Regional Quarterly Sales Report
description: This is the quarterly sales report, broken down by region.
thumbnail: images/thumbnail.jpg
author:
name: Michael Marchetti
email: [email protected]
username: mmarchetti
organization: Posit, PBC
tags:
- sales
- quarterly
- regional
files:
- report.qmd
- _quarto.yml
- model.py
- requirements.txt
- weights/sales-model.hdf5
dependencies:
python:
version: 3.11.3
package_file: requirements.txt
package_manager: pip
r:
version: 4.3.1
package_file: renv.lock
package_manager: renv
quarto:
version: '1.4'
environment:
API_URL: https://example.com/api
API_KEY:
schedule:
start: '2023-10-25T08:00:00Z'
recurrence: FREQ=MONTHLY;INTERVAL=3
access:
users:
- id: jqpublic
guid: 536b456e-0311-4f92-ba10-dbf1db8a468e
name: John Q. Public
permissions: editor
groups:
- id: Data Science Team
guid: 8b4fde3e-f995-4894-bc02-ae47538262ff
name: Data Science Team
permissions: editor
connect:
access:
run_as: rstudio-connect
run_as_current_user: false
runtime:
connection_timeout: 5
read_timeout: 30
init_timeout: 60
idle_timeout: 120
max_processes: 5
min_processes: 1
max_conns_per_process: 50
load_factor: 0.5
kubernetes:
amd_gpu_limit: 0
cpu_limit: 1
cpu_request: 0.5
image_name: posit/connect-runtime-python3.11-r4.3
memory_limit: '100000000'
memory_request: '20000000'
nvidia_gpu_limit: 0
service_account_name: posit-connect-content
r_environment_management: true
py_environment_management: true
48 changes: 48 additions & 0 deletions schema/posit-publishing-record-schema-v3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/rstudio/publishing-client/posit-publishing-record-schema-v3.json",
"type": "object",
"additionalProperties": false,
"description": "Posit Publishing Record",
"required": [
"$schema",
"server-url",
"id",
"configuration"
],
"properties": {
"$schema": {
"type": "string",
"format": "url",
"description": "URL of the json-schema definition for this file. Must be 'https://cdn.posit.co/connect/posit-publishing-schema-v3.json'.",
"enum": [
"./posit-publishing-record-schema-v3.json"
],
"examples": [
"./posit-publishing-record-schema-v3.json"
]
},
"server-url": {
"type": "string",
"format": "uri",
"description": "URL of the server where this content was deployed.",
"examples": [
"https://connect.example.com"
]
},
"id": {
"type": "string",
"description": "Unique ID of this deployment.",
"examples": [
"de2e7bdb-b085-401e-a65c-443e40009749"
]
},
"configuration": {
"type": "string",
"description": "Path to the configuration file within the project directory.",
"examples": [
"production.json"
]
}
}
}
Loading