-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-dev.wick
161 lines (161 loc) · 4.54 KB
/
app-dev.wick
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
---
kind: wick/app@v1
name: resume-refiner
metadata:
description: Demo application for refining resumes
version: 0.2.9
authors:
- 'Wick Team'
vendors:
- 'Candle Corporation'
licenses:
- Apache-2.0
package:
registry:
host: registry.candle.dev
namespace: candle-apps
files:
- ./ui/build
resources:
- name: httpserver
resource:
kind: wick/resource/tcpport@v1
port: '{{ ctx.env.HTTP_PORT }}'
address: 0.0.0.0
- name: DIR
resource:
kind: wick/resource/volume@v1
path: '{{__dirname}}/ui/build'
- name: PROXY_URL
resource:
kind: wick/resource/url@v1
url: http://localhost:5173
import:
- name: oauth_composite
component:
kind: wick/component/manifest@v1
ref: registry.candle.dev/common/oauth-sqlite:0.3.1
with:
auth_endpoint: https://auth.candle.dev/realms/candlecloud/protocol/openid-connect/auth
token_endpoint: https://auth.candle.dev/realms/candlecloud/protocol/openid-connect/token
logout_endpoint: https://auth.candle.dev/realms/candlecloud/protocol/openid-connect/logout
redirect_uri: '{{ ctx.env.OAUTH_REDIRECT_URI}}'
session_cookie_name: sid
session_cookie_duration_minutes: 20000
client_id: '{{ ctx.env.OAUTH_CLIENT_ID }}'
client_secret: '{{ ctx.env.OAUTH_CLIENT_SECRET }}'
scope: 'openid email'
db_url: '{{ ctx.env.DB_URL }}'
email_claim: email
logout_redirect_uri: '{{ ctx.env.OAUTH_LOGOUT_REDIRECT_URI }}'
redirect_logout: true
groups_claim: groups
- name: db_client
component:
kind: wick/component/manifest@v1
ref: ./wick/db/resume-sql.wick
with:
db_url: '{{ ctx.env.DB_URL }}'
- name: openai_api
component:
kind: wick/component/manifest@v1
ref: ./wick/http/openai-composite.wick
with:
api_key: '{{ ctx.env.API_KEY }}'
api_endpoint: '{{ ctx.env.API_ENDPOINT }}'
- name: candle_cloud_api
component:
kind: wick/component/manifest@v1
ref: ./wick/http/candlecloud-api.wick
with:
candle_cloud_api_endpoint: '{{ ctx.env.CANDLE_CLOUD_API_ENDPOINT }}'
- name: api
component:
kind: wick/component/manifest@v1
ref: ./wick/resumerefiner/component.wick
provide:
openai_client: openai_api
candle_cloud_client: candle_cloud_api
db_client: db_client
with:
entitlements:
- name: tokens
value: 5000
- name: migrations
component:
kind: wick/component/manifest@v1
ref: ./wick/db/migrations.wick
with:
db_url: '{{ ctx.env.DB_URL }}'
triggers:
- kind: wick/trigger/time@v1
schedule:
cron: '*/1 * * * * *'
repeat: 1
payload:
- name: name
value: 'migration_1'
operation: migrations::migration_1
- kind: wick/trigger/http@v1
resource: httpserver
routers:
- kind: wick/router/raw@v1
path: /oidc/userinfo
operation: oauth_composite::get_user
- kind: wick/router/raw@v1
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
codec: Json
path: /api/refine
operation: api::refine
- kind: wick/router/raw@v1
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
path: /login
operation: api::login
- kind: wick/router/raw@v1
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
path: /check_usage
operation: api::check_usage
- kind: wick/router/raw@v1
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
path: /confirm_star
operation: api::confirm_star
- kind: wick/router/raw@v1
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
path: /stargazer
operation: api::stargazer
- kind: wick/router/static@v1
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
path: /oidc/
volume: DIR
# - kind: wick/router/static@v1
# path: /
# volume: DIR
# fallback: index.html
- kind: wick/router/proxy@v1
url: PROXY_URL
middleware:
request:
- oauth_composite::auth
- oauth_composite::oidc
path: /oidc/
- kind: wick/router/proxy@v1
url: PROXY_URL
path: /