본문 바로가기
C.W.K.
Stream
Lesson 05 of 06 · published

클라우드 워크플로와 GitHub Actions

~16 min · remote, cicd, github-actions, cloud, spot-instances

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

빠르게 생각할 곳과 싸게 계산할 곳을 나눠

CI 실행기에 처음부터 거친 지시를 던져 비싼 계산 자원을 튜닝에 쓰지 마. 로컬에서 Claude와 작업을 충분히 다듬어 문맥을 만든 뒤, 무거운 부분만 원격 실행기로 넘기면 돼. 생각은 반응이 빠른 곳에서, 계산은 값싼 곳에서 하는 거야.

로컬 세션에서 방향을 잡고 claude remote handoff ci-runner로 넘기면 원격은 이미 쌓인 문맥으로 긴 테스트나 빌드를 끝내. 완전 무인 작업은 claude exec와 최종 메시지 출력 옵션을 cron이나 CI에 직접 붙일 수도 있어.

Spot이나 Preemptible VM을 대상으로 쓰면 비용을 60–90% 줄일 수 있어. 회수되기 전에 세션을 로컬로 되가져올 수 있으니 계산 자원은 일시적이어도 작업 문맥은 잃지 않아. 재현 가능한 container 환경과 결합하면 비용 절감이 운영 품질을 희생하지 않게 돼.

직접 확인할 항목: --output-last-message, claude.

Code

EC2 원격 대상 준비하기·bash
aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \
  --instance-type c6i.2xlarge \
  --key-name my-key \
  --security-group-ids sg-0abc123 \
  --tag-specifications 'ResourceType=instance,Tags=[{Key=Purpose,Value=claude-remote}]' \
  --user-data '#!/bin/bash
    apt-get update -y
    curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
    apt-get install -y nodejs git
    npm install -g @anthropic-ai/claude-code
  '

# Add to SSH config
echo "
Host claude-ci
    HostName \$(aws ec2 describe-instances ...)
    User ubuntu
    IdentityFile ~/.ssh/my-key.pem
" >> ~/.ssh/config

claude remote add claude-ci
야간 cron과 Spot Instance·bash
# crontab -e (on the always-on Remote target)
0 23 * * 1-5 /usr/local/bin/claude exec \
  --path /workspace/myproject \
  "Run full test suite, fix failures you can, update deps, \
   write a summary report." \
  --output-last-message \
  >> /var/log/claude-nightly.log 2>&1

# Or trigger from your local machine
claude remote handoff --resume claude-ci
# Walk away. Job runs on Spot. Comes back on local hand-back.

External links

Exercise

무료 사용량이나 가장 저렴한 Spot을 이용해 작은 클라우드 VM을 준비해. Claude Code를 설치하고 SSH를 설정한 뒤 Remote 대상으로 등록해. 긴 테스트 묶음처럼 원격으로 넘길 만한 실제 작업을 보내서 실행하고, 그동안 로컬에서 아낀 자원을 확인해.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.