Skip to content

Commit 4826659

Browse files
author
Yuriy Bezsonov
committed
Update specs
1 parent ec17321 commit 4826659

3 files changed

Lines changed: 106 additions & 63 deletions

File tree

.kiro/specs/arm64-code-editor-support/design.md

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,40 @@ Common settings shared by both IDEs:
217217
#!/bin/bash
218218
# Common IDE settings - sourced by vscode.sh and code-editor.sh
219219

220-
# Extensions for Java workshops
221-
EXTENSIONS="AmazonWebServices.aws-toolkit-vscode,vscjava.vscode-java-pack,ms-azuretools.vscode-docker,ms-kubernetes-tools.vscode-kubernetes-tools,esbenp.prettier-vscode,shardulm94.trailing-spaces"
220+
# Extensions to install
221+
EXTENSIONS="vscjava.vscode-java-pack,ms-azuretools.vscode-docker,ms-kubernetes-tools.vscode-kubernetes-tools"
222+
223+
# Extensions to uninstall (pre-installed but unwanted)
224+
EXTENSIONS_UNINSTALL="AmazonWebServices.aws-toolkit-vscode,AmazonWebServices.amazon-q-vscode"
222225

223226
# Default workspace folder
224227
DEFAULT_WORKSPACE="/home/ec2-user/environment"
225228

229+
# Uninstall extensions using provided binary
230+
# Usage: uninstall_ide_extensions <binary_command> <user>
231+
uninstall_ide_extensions() {
232+
local binary_cmd="$1"
233+
local user="$2"
234+
235+
IFS=',' read -ra extension_array <<< "$EXTENSIONS_UNINSTALL"
236+
for extension in "${extension_array[@]}"; do
237+
extension=$(echo "$extension" | xargs)
238+
if [ -n "$extension" ]; then
239+
echo "Uninstalling extension: $extension"
240+
sudo -u $user $binary_cmd --uninstall-extension $extension 2>/dev/null || true
241+
fi
242+
done
243+
}
244+
226245
# Install extensions using provided binary
227246
# Usage: install_ide_extensions <binary_command> <user>
228247
install_ide_extensions() {
229248
local binary_cmd="$1"
230249
local user="$2"
231250

251+
# First uninstall unwanted extensions
252+
uninstall_ide_extensions "$binary_cmd" "$user"
253+
232254
IFS=',' read -ra extension_array <<< "$EXTENSIONS"
233255
for extension in "${extension_array[@]}"; do
234256
extension=$(echo "$extension" | xargs)
@@ -280,15 +302,18 @@ configure_default_workspace "/home/ec2-user/.local/share/code-server/coder.json"
280302

281303
**File:** `java-on-aws/infra/scripts/ide/code-editor.sh` (NEW)
282304

283-
Minimal setup - use AWS Code Editor defaults, only configure:
305+
Setup includes:
284306
- Installation with checksum verification
285307
- Token auth
308+
- Settings.json (workspace trust disabled, terminal on startup, telemetry off, AWS Toolkit/Q popups suppressed)
286309
- Extensions (via shared function)
287-
- Default workspace (via shared function)
310+
- Default workspace folder (via shared function - coder.json)
288311
- Caddy proxy
289312
- Systemd service
290313

291-
**No custom settings.json** - use Code Editor defaults initially.
314+
**Note:** Two separate configs control the startup experience:
315+
1. **coder.json** - sets which folder opens in the file explorer (`~/environment`)
316+
2. **settings.json** - sets what opens in the editor area (`"workbench.startupEditor": "terminal"`)
292317

293318
```bash
294319
#!/bin/bash
@@ -305,10 +330,22 @@ CODE_EDITOR_PORT="8889"
305330
sudo -u $CODE_EDITOR_USER mkdir -p "/home/${CODE_EDITOR_USER}/.code-editor-server/data"
306331
echo -n "$IDE_PASSWORD" > "/home/${CODE_EDITOR_USER}/.code-editor-server/data/token"
307332

333+
# Settings.json - disable trust dialog, open terminal on startup, suppress popups
334+
sudo -u $CODE_EDITOR_USER tee "$settings_dir/settings.json" << 'EOF'
335+
{
336+
"security.workspace.trust.enabled": false,
337+
"workbench.startupEditor": "terminal",
338+
"telemetry.telemetryLevel": "off",
339+
"aws.telemetry": false,
340+
"aws.suppressPrompts": { ... },
341+
"amazonQ.showWalkthrough": false
342+
}
343+
EOF
344+
308345
# Extensions
309346
install_ide_extensions "/home/${CODE_EDITOR_USER}/.local/bin/code-editor-server" "$CODE_EDITOR_USER"
310347

311-
# Default workspace
348+
# Default workspace folder (coder.json)
312349
configure_default_workspace "/home/${CODE_EDITOR_USER}/.code-editor-server/data/coder.json" "$CODE_EDITOR_USER"
313350

314351
# Caddy (same as vscode.sh)

.kiro/specs/arm64-code-editor-support/requirements.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,16 @@ This feature adds ARM64 (Graviton) architecture support to the workshop IDE infr
5656

5757
### Requirement 4: Extension Installation Enhancement
5858

59-
**User Story:** As a workshop participant, I want the IDE to have all necessary extensions pre-installed, so that I can start coding immediately without manual setup.
59+
**User Story:** As a workshop participant, I want the IDE to have all necessary extensions pre-installed and unwanted pre-installed extensions removed, so that I can start coding immediately without distractions.
6060

6161
#### Acceptance Criteria
6262

63-
1. WHEN installing extensions THEN the System SHALL install AWS Toolkit extension (AmazonWebServices.aws-toolkit-vscode)
64-
2. WHEN installing extensions THEN the System SHALL install Java Extension Pack (vscjava.vscode-java-pack)
65-
3. WHEN installing extensions THEN the System SHALL install Docker extension (ms-azuretools.vscode-docker)
66-
4. WHEN installing extensions THEN the System SHALL install Kubernetes extension (ms-kubernetes-tools.vscode-kubernetes-tools)
67-
5. WHEN installing extensions THEN the System SHALL install Prettier extension (esbenp.prettier-vscode)
68-
6. WHEN installing extensions THEN the System SHALL install Trailing Spaces extension (shardulm94.trailing-spaces)
69-
7. WHEN extension installation fails THEN the System SHALL log the failure and continue with remaining extensions
63+
1. WHEN installing extensions THEN the System SHALL install Java Extension Pack (vscjava.vscode-java-pack)
64+
2. WHEN installing extensions THEN the System SHALL install Docker extension (ms-azuretools.vscode-docker)
65+
3. WHEN installing extensions THEN the System SHALL install Kubernetes extension (ms-kubernetes-tools.vscode-kubernetes-tools)
66+
4. WHEN extension installation fails THEN the System SHALL log the failure and continue with remaining extensions
67+
5. WHEN configuring Code Editor THEN the System SHALL uninstall pre-installed AWS Toolkit extension (AmazonWebServices.aws-toolkit-vscode)
68+
6. WHEN configuring Code Editor THEN the System SHALL uninstall pre-installed Amazon Q extension (AmazonWebServices.amazon-q-vscode)
7069

7170
### Requirement 5: Kiro CLI Installation
7271

@@ -108,3 +107,4 @@ This feature adds ARM64 (Graviton) architecture support to the workshop IDE infr
108107
1. WHEN installing extensions THEN the System SHALL use a shared function that accepts the IDE binary path as parameter
109108
2. WHEN the shared function is called THEN the System SHALL use retry logic for resilience
110109
3. WHEN the shared function is called THEN the System SHALL support both code-server and code-editor-server binaries
110+
4. WHEN the shared function is called THEN the System SHALL first uninstall unwanted extensions before installing new ones
Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Implementation Plan
22

3-
- [ ] 1. Add IdeArch and IdeType support to CDK Ide construct
4-
- [ ] 1.1 Create IdeArch enum in Ide.java
3+
- [x] 1. Add IdeArch and IdeType support to CDK Ide construct
4+
- [x] 1.1 Create IdeArch enum in Ide.java
55
- Add enum with ARM64 and X86_64 values
66
- Include helper methods for AWS and uname values
77
- _Requirements: 1.1_
8-
- [ ] 1.2 Create IdeType enum in Ide.java
8+
- [x] 1.2 Create IdeType enum in Ide.java
99
- Add enum with CODE_EDITOR and VSCODE values
1010
- Include scriptName helper method
1111
- _Requirements: 3.1_
12-
- [ ] 1.3 Add ideArch and ideType properties to IdeProps
12+
- [x] 1.3 Add ideArch and ideType properties to IdeProps
1313
- Add ideArch field with ARM64 default
1414
- Add ideType field with CODE_EDITOR default
1515
- Create static instance type lists for each architecture
@@ -18,146 +18,152 @@
1818
- Add builder methods for ideArch and ideType
1919
- Comment out old instance type list for reference
2020
- _Requirements: 1.2, 1.3, 1.5, 7.1, 7.2_
21-
- [ ] 1.4 Update UserData to export ARCH and IDE_TYPE
21+
- [x] 1.4 Update UserData to export ARCH and IDE_TYPE
2222
- Modify userdata.sh template to include ARCH and IDE_TYPE exports
2323
- Pass ideArch and ideType values from CDK to UserData
2424
- _Requirements: 1.4, 2.1_
25-
- [ ] 1.5 Write property test for ideArch → instance types mapping
25+
- [x] 1.5 Write property test for ideArch → instance types mapping
2626
- **Property 1: Architecture determines instance types**
2727
- **Validates: Requirements 1.2, 1.3, 7.1, 7.2**
2828

29-
- [ ] 2. Add architecture detection to base.sh
30-
- [ ] 2.1 Add architecture detection and normalization
29+
- [x] 2. Add architecture detection to base.sh
30+
- [x] 2.1 Add architecture detection and normalization
3131
- Read ARCH from environment or detect via uname
3232
- Create ARCH_K8S, ARCH_SAM, ARCH_GENERIC, ARCH_YQ variables
3333
- _Requirements: 2.1_
34-
- [ ] 2.2 Update kubectl download URL
34+
- [x] 2.2 Update kubectl download URL
3535
- Use ARCH_K8S variable in download URL
3636
- _Requirements: 2.2_
37-
- [ ] 2.3 Update SAM CLI download URL
37+
- [x] 2.3 Update SAM CLI download URL
3838
- Use ARCH_SAM variable in download URL
3939
- _Requirements: 2.3_
40-
- [ ] 2.4 Update eks-node-viewer download URL
40+
- [x] 2.4 Update eks-node-viewer download URL
4141
- Use ARCH_GENERIC variable in download URL
4242
- _Requirements: 2.4_
43-
- [ ] 2.5 Update SOCI snapshotter download URL
43+
- [x] 2.5 Update SOCI snapshotter download URL
4444
- Use ARCH_K8S variable (amd64/arm64) in download URL
4545
- _Requirements: 2.5_
46-
- [ ] 2.6 Update yq download URL
46+
- [x] 2.6 Update yq download URL
4747
- Use ARCH_YQ variable in download URL
4848
- _Requirements: 2.6_
49-
- [ ] 2.7 Update Java path for ARM64
49+
- [x] 2.7 Update Java path for ARM64
5050
- Handle different Java paths for aarch64 vs x86_64
5151
- _Requirements: 2.1_
5252

53-
- [ ] 3. Checkpoint - Verify architecture detection works
53+
- [x] 3. Checkpoint - Verify architecture detection works
5454
- Ensure all tests pass, ask the user if questions arise.
5555

56-
- [ ] 4. Create ide-settings.sh with common IDE configuration
57-
- [ ] 4.1 Create ide-settings.sh file
58-
- Define EXTENSIONS variable with full list
56+
- [x] 4. Create ide-settings.sh with common IDE configuration
57+
- [x] 4.1 Create ide-settings.sh file
58+
- Define EXTENSIONS variable with extensions to install
59+
- Define EXTENSIONS_UNINSTALL variable with pre-installed extensions to remove
5960
- Define DEFAULT_WORKSPACE variable
60-
- _Requirements: 4.1-4.6_
61-
- [ ] 4.2 Add install_ide_extensions function
61+
- _Requirements: 4.1-4.4_
62+
- [x] 4.2 Add uninstall_ide_extensions function
63+
- Accept binary command and user as parameters
64+
- Loop through EXTENSIONS_UNINSTALL and remove each
65+
- _Requirements: 4.5, 4.6_
66+
- [x] 4.3 Add install_ide_extensions function
6267
- Accept binary command and user as parameters
68+
- First call uninstall_ide_extensions to remove unwanted extensions
6369
- Loop through extensions with retry logic
64-
- _Requirements: 4.7, 8.1, 8.2, 8.3_
65-
- [ ] 4.3 Add configure_default_workspace function
70+
- _Requirements: 4.4, 8.1, 8.2, 8.3, 8.4_
71+
- [x] 4.4 Add configure_default_workspace function
6672
- Accept coder.json path and user as parameters
6773
- Create workspace config if not exists
6874
- _Requirements: 4.1_
6975

70-
- [ ] 5. Create code-editor.sh for AWS Code Editor
71-
- [ ] 5.1 Add code-editor installation function
76+
- [x] 5. Create code-editor.sh for AWS Code Editor
77+
- [x] 5.1 Add code-editor installation function
7278
- Download manifest from code-editor.amazonaws.com
7379
- Support ARM64 and x64 architectures
7480
- _Requirements: 3.1_
75-
- [ ] 5.2 Add checksum verification
81+
- [x] 5.2 Add checksum verification
7682
- Verify SHA256 checksum against manifest
7783
- Fail with clear error on mismatch
7884
- _Requirements: 3.2_
79-
- [ ] 5.3 Add installation to user's .local directory
85+
- [x] 5.3 Add installation to user's .local directory
8086
- Extract to ~/.local/lib/code-editor-VERSION/
8187
- Create symlink in ~/.local/bin/
8288
- _Requirements: 3.3_
83-
- [ ] 5.4 Add systemd service configuration
89+
- [x] 5.4 Add systemd service configuration
8490
- Create code-editor@.service unit file
8591
- Configure for port 8889
8692
- Accept server license terms
8793
- _Requirements: 3.4, 3.5_
88-
- [ ] 5.5 Add token authentication setup
94+
- [x] 5.5 Add token authentication setup
8995
- Create ~/.code-editor-server/data/token file
9096
- Write IDE_PASSWORD to token file
9197
- _Requirements: 6.1_
92-
- [ ] 5.6 Add Caddy proxy configuration
98+
- [x] 5.6 Add Caddy proxy configuration
9399
- Configure Caddy to proxy port 8889
94100
- Same config as vscode.sh
95101
- _Requirements: 3.6_
96-
- [ ] 5.7 Source ide-settings.sh and call shared functions
102+
- [x] 5.7 Source ide-settings.sh and call shared functions
97103
- Call install_ide_extensions with code-editor-server
98104
- Call configure_default_workspace
99105
- _Requirements: 4.1-4.7_
100106

101-
- [ ] 6. Update vscode.sh to use shared settings
102-
- [ ] 6.1 Source ide-settings.sh
107+
- [x] 6. Update vscode.sh to use shared settings
108+
- [x] 6.1 Source ide-settings.sh
103109
- Remove inline EXTENSIONS variable
104110
- Source ide-settings.sh at top of file
105111
- _Requirements: 4.1-4.6_
106-
- [ ] 6.2 Use install_ide_extensions function
112+
- [x] 6.2 Use install_ide_extensions function
107113
- Replace inline extension loop with function call
108114
- Pass "code-server" and "ec2-user"
109115
- _Requirements: 4.7_
110-
- [ ] 6.3 Use configure_default_workspace function
116+
- [x] 6.3 Use configure_default_workspace function
111117
- Replace inline coder.json creation with function call
112118
- _Requirements: 4.1_
113119

114-
- [ ] 7. Update bootstrap.sh for IDE selection
115-
- [ ] 7.1 Read IDE_TYPE from environment
120+
- [x] 7. Update bootstrap.sh for IDE selection
121+
- [x] 7.1 Read IDE_TYPE from environment
116122
- Use IDE_TYPE from UserData (set by CDK)
117123
- Default to "code-editor" if not set
118124
- _Requirements: 3.1_
119-
- [ ] 7.2 Add dynamic code alias to workshop.sh
125+
- [x] 7.2 Add dynamic code alias to workshop.sh
120126
- Set alias based on IDE_TYPE
121127
- code-editor: /home/ec2-user/.local/bin/code-editor-server
122128
- vscode: code-server
123129
- _Requirements: 3.4_
124-
- [ ] 7.3 Update IDE setup call
130+
- [x] 7.3 Update IDE setup call
125131
- Change from hardcoded vscode.sh to ${IDE_TYPE}.sh
126132
- _Requirements: 3.1_
127133

128-
- [ ] 8. Update shell.sh for both IDEs
129-
- [ ] 8.1 Update .zshrc code alias
134+
- [x] 8. Update shell.sh for both IDEs
135+
- [x] 8.1 Update .zshrc code alias
130136
- Add dynamic alias that detects installed IDE
131137
- Check for code-editor-server first, then code-server
132138
- _Requirements: 3.4_
133-
- [ ] 8.2 Update settings.json zsh configuration
139+
- [x] 8.2 Update settings.json zsh configuration
134140
- Check both code-server and code-editor settings.json paths
135141
- Update whichever exists
136142
- _Requirements: 3.4_
137143

138-
- [ ] 9. Add Kiro CLI installation to base.sh
139-
- [ ] 9.1 Add install_kiro_cli function
144+
- [x] 9. Add Kiro CLI installation to base.sh
145+
- [x] 9.1 Add install_kiro_cli function
140146
- Download and run Kiro CLI installer
141147
- Use retry_optional for resilience
142148
- _Requirements: 5.1_
143-
- [ ] 9.2 Add version verification
149+
- [x] 9.2 Add version verification
144150
- Check kiro-cli --version after install
145151
- Log warning if verification fails
146152
- _Requirements: 5.2, 5.3_
147-
- [ ] 9.3 Call install_kiro_cli in base.sh
153+
- [x] 9.3 Call install_kiro_cli in base.sh
148154
- Add to end of base.sh before shell setup
149155
- _Requirements: 5.1_
150156

151-
- [ ] 10. Checkpoint - Test full bootstrap
157+
- [x] 10. Checkpoint - Test full bootstrap
152158
- Ensure all tests pass, ask the user if questions arise.
153159

154-
- [ ] 11. Update CDK URL output for conditional token-based access
155-
- [ ] 11.1 Modify Ide.java URL output based on IdeType
160+
- [x] 11. Update CDK URL output for conditional token-based access
161+
- [x] 11.1 Modify Ide.java URL output based on IdeType
156162
- For CODE_EDITOR: Include ?folder= and ?tkn= parameters
157163
- Format: https://domain/?folder=/home/ec2-user/environment&tkn=PASSWORD
158164
- For VSCODE: Standard URL without token (password via login page)
159165
- Format: https://domain/
160166
- _Requirements: 6.2, 6.3_
161167

162-
- [ ] 12. Final Checkpoint - Verify complete setup
168+
- [x] 12. Final Checkpoint - Verify complete setup
163169
- Ensure all tests pass, ask the user if questions arise.

0 commit comments

Comments
 (0)