-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcopier.yaml
214 lines (175 loc) · 5.65 KB
/
copier.yaml
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
_subdirectory: .copier-template
# Configure jinja2 defaults to make syntax highlighters lives easier
_templates_suffix: .jinja
_envops:
block_end_string: "%}"
block_start_string: "{%"
comment_end_string: "#}"
comment_start_string: "{#"
keep_trailing_newline: true
variable_end_string: "}}"
variable_start_string: "{{"
_answers_file: .copier-docker-config.yaml
_tasks:
# Strings get executed under system's default shell
- "[ -d .git ] || git init"
- "{% if github_repo_name %}git add remote origin https://github.com/{{ github_username }}/{{ github_repo_name }}.git 2>/dev/null || echo 'origin already exists'{% else %}echo 'No GitHub repository name provided. Skipping git remote add.'{% endif %}"
# questions
docker_project_name:
type: str
help: What is your docker project name? (it will be used as docker image name)
validator: >-
{% if not (docker_project_name | regex_search('^[a-z][a-z0-9\-]+$')) %}
docker_project_name must start with a letter, followed one or more letters, digits or dashes in lowercase only
{% endif %}
friendly_name:
default: "{{ docker_project_name }}"
type: str
help: What is your project friendly name? (it will be used for the title of the documentation)
project_short_description:
type: str
help: What is your project short description?
project_description:
type: str
help: What is your project description?
project_license:
type: str
choices:
- MIT
- CC-BY-4.0
- Apache-2.0
- GPLv3
- None
author:
type: str
help: What is your name?
validator: >-
{% if not (author | regex_search('^[a-zA-Z][a-zA-Z ]+$')) %}
author must start with a letter, followed one or more letters or spaces
{% endif %}
github_username:
type: str
help: What is your GitHub username?
validator: >-
{% if not (github_username | regex_search('^[a-z0-9][a-z0-9\-]+$')) %}
github_username must start with a letter or digit, followed one or more letters, digits or dashes in lowercase only
{% endif %}
email:
default: "{{ github_username }}@"
type: str
help: What is your email?
validator: >-
{% if not (email | regex_search('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$')) %}
email must be a valid email address
{% endif %}
github_repo_name:
default: "{{ docker_project_name }}"
type: str
help: What is your GitHub repository name?
docker_username:
default: "{{ github_username }}"
type: str
help: What is your Docker username?
docker_base_image_variant_name:
default: base
type: str
help: What is your Docker base image variant?
docker_app_image_variant_name:
default: app
type: str
help: What is your Docker app image variant? (it will be built from the base image)
docker_registry:
default: ghcr.io
type: str
help: What is your Docker registry? (e.g. ghcr.io)
docker_base_build_from:
default: python:3.9-slim-bookworm
type: str
help: What is your Docker image build from?
docker_timezone:
default: Asia/Seoul
type: str
help: What is your Docker time zone?
docker_apt_packages:
default: "fontconfig fonts-nanum"
type: str
help: What is your additional apt packages to install? (separated by space, "curl wget jq sudo tzdata locales locales-all python3-launchpadlib software-properties-common" by default)
docker_container_username:
default: "app"
type: str
help: What is the username of the docker container? (non-root user)
docker_container_uid:
default: 9001
type: int
help: What is the uid of the docker container user?
install_dotfiles:
default: true
type: bool
help: Do you want to install dotfiles?
container_workspace_root:
default: /workspace
type: str
help: What is the workspace root in the docker container?
copy_scripts_dir:
default: true
type: bool
help: "Do you want to copy scripts directory under the workspace root? ? (COPY ./.docker/scripts/ ./scripts/)"
install_pip_requirements:
default: true
type: bool
help: "Do you want to install pip requirements? (add dependencies to requirements.txt under the scripts directory)"
docker_run_command:
default: /bin/zsh
type: str
help: "What is your command to run when the docker image is run? (default: /bin/zsh)"
clone_source_code:
default: true
type: bool
help: Do you want to clone source code?
app_source_repo:
type: str
help: What is your source repository URL to clone? (e.g. github_username/repo_name)
app_source_branch:
default: main
type: str
help: "What is your source repository branch to clone? (default: main)"
app_install_root:
default: "{{ container_workspace_root }}/projects"
type: str
help: "What is your source install root? (default: {{ container_workspace_root }}/projects)"
app_clone_dirname:
default: "{{ app_source_repo | regex_replace('.*/', '') }}"
type: str
help: "What is your source repository directory name to clone? (default: {{ app_source_repo | regex_replace('.*/', '') }})"
app_server_name:
default: app
type: str
help: What is your app server name?
launch_scripts:
default: launch.sh
type: str
help: What is your launch script to run when the docker image is run? (put it in the docker scripts directory)
enable_nvidia_gpu:
default: true
type: bool
help: Do you want to enable NVIDIA GPU?
cuda_device_id:
default: all
type: str
help: "What is your CUDA device to use? (default: all)"
start_ssh_service:
default: true
type: bool
help: Do you want to use SSH?
ssh_host_port:
default: 2222
type: int
help: "What is your SSH host port to expose? (default: 2222)"
start_jupyter:
default: true
type: bool
help: Do you want to use Jupyter?
jupyter_host_port:
default: 18888
type: int
help: "What is your Jupyter host port to expose? (default: 8888)"