Slide 1

Slide 1 text

"84Ͱ΋#VJMEQBDLTΛ࢖ͬͯ%PDLFSpMFϨεʹग़དྷΔͷ͔ ࠤ౻ஐथ $9ࣄۀຊ෦੡଄ϏδωεςΫϊϩδʔ෦

Slide 2

Slide 2 text

ࣗݾ঺հ ࠤ౻ஐथ $9ࣄۀຊ෦੡଄ϏδωεςΫϊϩδʔ෦ ΞʔΩςΫτνʔϜϚωʔδϟʔ +"846($%,ࢧ෦ӡӦ झຯɿδϜ ޷͖ͳ"84αʔϏεɿ-BNCEBɺ$%, !UNL !UPNPLJ &YQJSFE

Slide 3

Slide 3 text

໨࣍ w "84্ͰͷίϯςφηΩϡϦςΟ֓ཁ w %PDLFSpMFΛ࡞Δͱ͍͏͜ͱ w $MPVE/BUJWF#VJMEQBDLT $/# ͷ঺հ w ଞΫϥ΢υͰͷ$/#ͷѻ͍ w ࣮ࡍͷίʔυͰσϞ w ͓·͚

Slide 4

Slide 4 text

ίϯςφηΩϡϦςΟͷ֓ཁ &$4PO'BSHBUFʹ͍ͭͯ͸Ҏલ͜ͷࢿྉͰ·ͱΊ·ͨ͠ IUUQTEFWDMBTTNFUIPEKQBSUJDMFTTFDVSJUZGPSFDTPOGBSHBUFTFDKBXTEBZT

Slide 5

Slide 5 text

ίϯςφηΩϡϦςΟͷ֓ཁ ࠓ೔͸ίίͷ࿩ʂ &$4 'BSHBUF &$3 &$44FSWJDF5BTLͳͲ %PDLFSGJMF 71$ͳͲ /FUXPSL *NBHF 3FHJTUSZ $POUBJOFS 0SDIFTUSBUPS )PTU04 $POUBJOFS3VOUJNF "QQMJDBUJPO "84 *".

Slide 6

Slide 6 text

%PDLFSpMFΛॻ͘ϕετϓϥΫςΟε w Ұ࣌తͳίϯςφΛ࡞੒ w ϏϧυίϯςΫετͷཧղ w ඪ४ೖྗΛ௨ͯ͠%PDLFSpMFΛ ύΠϓ w EPDLFSJHOPSFͰআ֎ w ϚϧνεςʔδɾϏϧυΛ࢖͏ w ෆཁͳύοέʔδͷΠϯετʔϧ ېࢭ w ΞϓϦέʔγϣϯΛ੾Γ཭͢ w ϨΠϠͷ਺Λ࠷খʹ w ෳ਺ߦʹΘͨΔҾ਺͸ฒͼΛద੾ ʹ w ϏϧυɾΩϟογϡͷ׆༻ IUUQTEPDTEPDLFSKQEFWFMPQEFWFMPQJNBHFTEPDLFSpMF@CFTUQSBDUJDFTIUNM ଞʹ΋ҙࣝ͢΂͖͜ͱ͕ଟ਺

Slide 7

Slide 7 text

%PDLFSpMFΛॻ͘ϕετϓϥΫςΟε w Ұ࣌తͳίϯςφΛ࡞੒ w ϏϧυίϯςΫετͷཧղ w ඪ४ೖྗΛ௨ͯ͠%PDLFSpMFΛ ύΠϓ w EPDLFSJHOPSFͰআ֎ w ϚϧνεςʔδɾϏϧυΛ࢖͏ w ෆཁͳύοέʔδͷΠϯετʔϧ ېࢭ w ΞϓϦέʔγϣϯΛ੾Γ཭͢ w ϨΠϠͷ਺Λ࠷খʹ w ෳ਺ߦʹΘͨΔҾ਺͸ฒͼΛద੾ ʹ w ϏϧυɾΩϟογϡͷ׆༻ IUUQTEPDTEPDLFSKQEFWFMPQEFWFMPQJNBHFTEPDLFSpMF@CFTUQSBDUJDFTIUNM ଞʹ΋ҙࣝ͢΂͖͜ͱ͕ଟ਺ ΍Δ͜ͱ͕ɾɾ ΍Δ͜ͱ͕ଟ͍ɾɾʂʂ

Slide 8

Slide 8 text

$MPVE/BUJWF#VJMEQBDLT $/# ͷ঺հ %PDLFSpMFͷ୅ସπʔϧͷͭͰɺ%PDLFSpMFΛ࢖Θͣʹ0QFO $POUBJOFS*OJUJBUJWF 0$* ४ڌͷίϯςφΠϝʔδΛ࡞੒͢Δ࢓૊Έ 4PVSDF $PEF #VJMEQBDLT 1BDL$-* ಡΈऔΓ ඞཁϦιʔε Λղੳ $POUBJOFS *NBHF ࡞੒

Slide 9

Slide 9 text

%PDLFSpMFͱ$/#ͷҧ͍ %PDLFSpMFͷੈք 4PVSDF $PEF #VJMEQBDLT 1BDL$-* $POUBJOFS *NBHF ࡞੒ $/#ͷੈքʢཧ૝ʣ 4PVSDF $PEF ಡΈऔΓ %PDLFSpMF ࡞੒º $POUBJOFS *NBHF ࡞੒ ಡΈऔΓ ඞཁϦιʔε Λղੳ

Slide 10

Slide 10 text

BuildpacksͷଞͷΫϥ΢υͰͷѻ͍ w (PPHMF$MPVEͷ৔߹ w $/#ͷ࢓༷Λ࣮૷͠ɺ(PPHMF$MPVEͷ֤αʔϏεʹσϓϩΠՄೳͳ ίϯςφΛϏϧυͯ͠ߏ੒͢ΔΑ͏ʹઃܭ͞Ε͍ͯΔ˞ w "[VSFͷ৔߹ w "[VSF$-*ʹ$/#ͷ1BDL$-*͕૊Έࠐ·Ε͓ͯΓɺ"[VSFίϚϯυͷ தͰ࢖༻͢Δ͜ͱ͕Ͱ͖ΔʢϓϨϏϡʔʣ˞ w "84ͷ৔߹ w ૊ΈࠐΈํͷϒϩάͷΈʢ࣍εϥΠυʣ ˞IUUQTDMPVEHPPHMFDPNEPDTCVJMEQBDLTPWFSWJFX IMKB ˞IUUQTMFBSONJDSPTPGUDPNKBKQB[VSFDPOUBJOFSSFHJTUSZDPOUBJOFSSFHJTUSZUBTLTQBDLCVJME

Slide 11

Slide 11 text

CNBΛAWSͰ࢖͏৔߹ $MPVE/BUJWF#VJMEQBDLTʹΑΔ"84$PEF#VJMEͱ "84$PEF1JQFMJOFΛ࢖ͬͨίϯςφΠϝʔδͷ࡞੒ IUUQTBXTBNB[PODPNKQCMPHTOFXTDSFBUJOHDPOUBJOFSJNBHFTXJUIDMPVEOBUJWFCVJMEQBDLTVTJOHBXTDPEFCVJMEBOEBXTDPEFQJQFMJOF

Slide 12

Slide 12 text

ࠓճ࡞ͬͨύΠϓϥΠϯશମͷΠϝʔδ "DUJPOT &$3 'BSHBUF $%, $%, खಈ σϓϩΠ ϦϙδτϦ࡞੒ NBJO QVTI $/#ͰJNBHF CVJMEQVTI DELEFQMPZ EFQMPZ &$4 *NBHFQVMM

Slide 13

Slide 13 text

ࠓճ࡞ͬͨύΠϓϥΠϯશମͷΠϝʔδ "DUJPOT &$3 'BSHBUF $%, $%, खಈ σϓϩΠ ϦϙδτϦ࡞੒ NBJO QVTI DELEFQMPZ EFQMPZ &$4 *NBHFQVMM $/#ͰJNBHF CVJMEQVTI

Slide 14

Slide 14 text

(JU)VC"DUJPOTͷઃఆ env: builder: "paketobuildpacks/builder-jammy-base" pack_version: "0.33.1" ecr_repo_name: "cloudnative-buildpack-sample" jobs: build: runs-on: ubuntu-latest permissions: id-token: write contents: read steps: - name: Checkout code uses: actions/checkout@v4 - name: Assume Role uses: aws-actions/configure-aws-credentials@v4 with: aws-region: "ap-northeast-1" role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }} - name: Login to ECR uses: aws-actions/amazon-ecr-login@v2

Slide 15

Slide 15 text

(JU)VC"DUJPOTͷઃఆ - name: Set up environment variables run: | COMMIT_HASH=$(echo $GITHUB_SHA | cut -c 1-7) ECR_DOMAIN="${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.ap- northeast-1.amazonaws.com" ECR_REPOSITORY="$ECR_DOMAIN/${{ env.ecr_repo_name }}" IMAGE_TAG="$ECR_REPOSITORY:$COMMIT_HASH" echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV - name: Install pack run: | wget -q https://github.com/buildpacks/pack/releases/download/v$ {{ env.pack_version }}/pack-v${{ env.pack_version }}-linux.tgz -O - | tar -xz chmod +x ./pack - name: Build and push Docker image run: | ./pack build $IMAGE_TAG --no-color --builder ${{ env.builder }} \ --path src/my-app --tag $IMAGE_TAG --publish #VJMEQBDLTΛ࢖ͬͯ*NBHF#VJMEͱ&$3΁ͷQVTI

Slide 16

Slide 16 text

(JU)VC"DUJPOTͷઃఆ - name: Setup Node.js 20 uses: actions/setup-node@v4 with: node-version: "20" cache: npm - name: Install dependencies run: npm ci - name: ECS Deploy run: | npx cdk deploy "EcsStack" -c imageTag=$COMMIT_HASH $PNNJU)BTIͰ&$3ͷ*NBHFΛࢦఆͯ͠ɺ$%,Ͱ&$4΁σϓϩΠ ஫ҙɿBuildepacksͷAction΋͋ΔΒ͍͠ ɹɹɹʮhttps://github.com/buildpacks/github-actionsʯ

Slide 17

Slide 17 text

ύΠϓϥΠϯͷσϞ "DUJPOT &$3 'BSHBUF $%, $%, खಈ σϓϩΠ ϦϙδτϦ࡞੒ NBJO QVTI $/#ͰJNBHF CVJMEQVTI DELEFQMPZ EFQMPZ &$4 *NBHFQVMM

Slide 18

Slide 18 text

ಈ͔͢·Ͱͷ஫ҙ఺ w ·ͣ͸ެࣜϦϑΝϨϯεΛͬ͟ͱಡΉ w ࣍ʹCVJMEQBDLTBNQMFT˞Λಈ͔͢͜ͱ͔Β࢝ΊΔͱྑ͍ w (PPHMF$MPVE༻ʹݟ͑Δ͕ॻ͖ํ͸ಉ͡ͳͷͰਅࣅग़དྷΔ w ެࣜͩͱαϯϓϧ͕ͳ͍ͷͰɺมͳͱ͜Ͱ٧·Γ΍͍͢ w QBDLBHFKTPOͷ%FQFOEFODZΛಡΈऔΔͷͰɺඞཁͳ΋ͷ͸શؚͯΉ Α͏ʹߏ੒͢Δ w ࢖͏#VJMEFS͸QBDLTVHHFTUCVJMEFSTίϚϯυͰઌʹ֬ೝ͢Δ ˞IUUQTHJUIVCDPN(PPHMF$MPVE1MBUGPSNCVJMEQBDLTBNQMFTUSFFNBTUFS

Slide 19

Slide 19 text

ݸਓతʹࢥ͏ར఺ w ͱʹ͔͘%PDLFSpMFΛॻ͔ͳͯ͘ྑ͍ͷ͸ָ w αϯϓϧϨϕϧͩͱ࣮ײ͠ʹ͍͕͘ɺηΩϡϦςΟΛҙࣝ࢝͠ΊΔຊ൪ Ϩϕϧͩͱӡ༻࣌ͷෛՙ͕ঃʑʹܰ͘ͳ͍ͬͯ͘͜ͱ͕ظ଴Ͱ͖Δ w ମײͰద౰ͳϕʔεΠϝʔδΛબ୒͢Δ৔߹ͱൺ΂ͯɺ੬ऑੑͷΞϥʔ τ͕গͳΊ w େن໛ͳ૊৫ͩͱɺແடংͳ%PDLFSpMFʹࢧ഑͞ΕͮΒ͘ͳΔʁ w %PDLFSpMFͷॻ͖ํʹൺ΂ͯɺ࢖༻͢Δ#VJMEFSͷબఆ΍੔ཧͷํ͕൚༻ తʹల։͠΍͍͔͢΋ʁ

Slide 20

Slide 20 text

ݸਓతʹࢥ͏ͦ͜·Ͱීٴͯ͠ͳ͍ཧ༝ ஫ҙɿҰ୴ࢼͨ͠ݸਓͷײ૝Ͱ͢ɻۃΊΕ͹มΘΔ͔΋ʁ w ։ൃ؀ڥΛ࡞ΓͮΒ͍ɻ؀ڥઃఆ͕ιʔεʹΑͬͯมΘͬͯ͠·͏ w $16͕"3.ΞʔΩͩͱ޻෉͕ඞཁ˞ Ұ෦ͷػೳ͸ͦͷ··ಈ͘ w #VJMEFSͰΧόʔͰ͖ͳ͍৔߹͸मਖ਼͕ඞཁɻ݁ہ͸ཁ$/#৬ਓʁ w $/#पΓͰ͏·͍͔͘ͳ͍৔߹ɺௐ΂ͯ΋৘ใ͕গͳ͍ w 6OJYTPDLFUΛ࡞੒͠ͳ͍ιϑτ 'JODI Ͱ͸࢖͑ͳ͍ʁ˞ w ੬ऑੑͷηΩϡϦςΟΞϥʔτ͕ग़Δ৔߹ͷରԠํ๏ ˞IUUQTHJUIVCDPNENJLVTBQBLFUPBSN ˞IUUQTHJUIVCDPNSVOpODIpODIJTTVFTJTTVFDPNNFOU

Slide 21

Slide 21 text

$/#ͷੈքʢݱ࣮ʣ 4PVSDF $PEF #VJMEQBDLT 1BDL$-* $POUBJOFS *NBHF ࡞੒ ಡΈऔΓ ඞཁϦιʔε Λղੳ ɾ#VJMEFSͷબఆ ɾιʔεΛQBDLDMJ४ڌʹઃఆ ɾ#VJMEFSΧελϜ ɾηΩϡϦςΟରԠ FUDʜ $/#৬ਓ

Slide 22

Slide 22 text

·ͱΊ w "84Ͱ΋#VJMEQBDLTΛ࢖ͬͯ%PDLFSpMFϨεʹग़དྷΔͷ͔ w αϯϓϧϨϕϧͷΞϓϦͳΒͰ͖Δ w ຊ൪ӡ༻ʹ޲͚ͯ͸QBDL΍#VJMEFSͳͲͷ͞ΒͳΔཧղ͕ඞཁ w %PDLFSpMFΛॻ͔ͣʹΠϝʔδ͕σϓϩΠͰ͖ΔͷͰָ w $/#ಛ༗ͷઃఆʹ׳ΕΔඞཁ͸͋Δ w ։ൃ؀ڥɺ#VJMEFSɺ੬ऑੑରԠํ๏FUDʜ