-
Notifications
You must be signed in to change notification settings - Fork 31
/
_content_admin.qmd
193 lines (145 loc) · 5.03 KB
/
_content_admin.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
title: "Content Admin"
date: "`r Sys.time()`"
output: html_document
---
This purpose of this script is to programatically manage the deployed content on Posit Connect.
```{r setup}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
library(rsconnect)
library(connectapi)
# Establish a connection to Posit connect.
client <- connect(
server = Sys.getenv("CONNECT_SERVER"),
api_key = Sys.getenv("CONNECT_API_KEY")
)
tags <- get_tags(client)$`Projects and Presentations`$`Bike Predict`
repo_url <- "https://github.com/sol-eng/bike_predict"
```
## 1 ETL
### 1.1 Raw Data Refresh
```{r}
guid <- "a4cea054-c92d-4764-970d-b3473239c939"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-raw-data-refresh", force = TRUE)
set_content_tags(content, tags$R$ETL)
set_image_path(content, "./content/01-etl/01-raw-data-refresh/icon.drawio.png")
```
#### 1.1.1 Pinned station info
Running the raw 1.1 Raw Data Refresh will update the following pin:
```{r}
# Pinned station info
guid <- "00036e13-9a3c-44c6-84eb-253de91b10c2"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_content_tags(content, tags$R$ETL)
set_image_path(content, "./img/icon-pins-data.drawio.png")
```
### 1.2 Tidy data
```{r}
guid <- "82fe2eea-0164-4823-98e3-ff15f1d31036"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-tidy-data", force = TRUE)
set_content_tags(content, tags$R$ETL)
set_image_path(content, "./content/01-etl/02-tidy-data/icon.drawio.png")
```
## 2 Model
### 2.1 Train and Deploy Model
```{r}
guid <- "07b3ff23-595b-4f8b-9f28-7c393cf230ef"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-train-and-deploy-model", force = TRUE)
set_content_tags(content, tags$R$Model)
set_image_path(content, "./content/02-model/01-train-and-deploy-model/icon.drawio.png")
```
#### 2.1.1 Pinned Model
Running the *2.1 Train and Deploy Model* script will update the following pinned model:
```{r}
# Pinned model
guid <- "0273207f-0f1f-44cb-845e-408f9dae2dd6"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_content_tags(content, tags$R$Model)
set_image_path(content, "./img/icon-pins-model.drawio.png")
```
#### 2.1.2 Deployed API
Running the *2.1 Train and Deploy Model* script will deplooy the following API:
```{r}
# Deployed API
guid <- "69186bcd-5a1d-4607-a68b-da78ee6cdf2a"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_content_tags(content, tags$R$Model)
set_image_path(content, "./img/icon-plumber.drawio.png")
```
### 2.2 Model Card
```{r}
guid <- "db334c42-9c7c-4102-8127-71c2ea82fba6"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-model-card", force = TRUE)
set_content_tags(content, tags$R$Model)
set_image_path(content, "./content/02-model/02-model-card/icon.drawio.png")
```
### 2.3 Model Metrics
#### 2.3.1 Model Metrics Document
```{r}
guid <- "e2c4d2ce-8ad7-4e10-9e57-4f9a07677141"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-model-metrics", force = TRUE)
set_content_tags(content, tags$R$Model)
set_image_path(content, "./content/02-model/03-model-metrics/icon.drawio.png")
```
#### 2.3.2 Model Metrics Pin
```{r}
guid <- "91d5bac2-db5f-44b6-b41b-d85138f48d8d"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-model-metrics-pin", force = TRUE)
set_content_tags(content, tags$R$Model)
set_image_path(content, "./img/icon-pins-model.drawio.png")
```
## 3 App
### 3.1 Client App
```{r}
guid <- "0477855b-caeb-43e8-b3d9-28e0965e6230"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-client-app", force = TRUE)
set_content_tags(content, tags$R$App)
set_image_path(content, "./content/03-app/01-client-app/icon.drawio.png")
```
### 3.2 Connect Widgets App
```{r}
guid <- "3124a8f9-7d30-44b9-a49a-552db71b036e"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-dashboard", force = TRUE)
set_content_tags(content, tags$R$App)
set_image_path(content, "./content/03-app/02-connect-widgets-app/icon.drawio.png")
```
### 3.3 Client App Dev
```{r}
guid <- "bdc0b532-6b42-4341-8310-73da49eafe09"
content <- content_item(client, guid)
# Configure content settings
content$update(access_type = "all")
set_vanity_url(content, "bike-predict-r-client-app-dev", force = TRUE)
set_content_tags(content, tags$R$App)
set_image_path(content, "./content/03-app/03-client-app-dev/icon.drawio.png")
```