-
Notifications
You must be signed in to change notification settings - Fork 0
[URECA-65] Feat: 긴 STT #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
55d15a2
feat: google cloud storage 연결
40food b64ff5c
Merge branch 'develop' into URECA-65/Feat/longerstt
40food 298003c
fix: 녹음 불가 문제 수정 및 긴 STT 구현
40food af33842
fix: 코드 리뷰 반영
40food cdc3640
feat: 배포 준비
40food 719caf2
fix: 빌드 문제 수정 및 리뷰 반영
40food bd1c5b3
Merge branch 'develop' into URECA-65/Feat/longerstt
40food 953949a
fix: mainClass 경로 설정
40food 4389db6
fix: 배포 jar 설정 수정
40food ce98dd0
fix: jar 경로 수정
40food 88bb24f
fix: jar 경로 재설정
40food 7415665
fix: Docker file 수정
40food 7ef8d3a
Revert "fix: Docker file 수정"
40food 95d2de0
fix: 도커 설정 수정...
40food f058689
fix: dockerfile 제발 마지막 수정이길
40food 6182572
fix: 진짜 찐막
40food 1ec5008
fix: gradlew 실행권한 부여
40food f4e305e
fix: render를 google sql에 연결
40food 449b2d9
fix: render를 google sql에 연결2
40food 02e4ac7
fix: render를 google sql에 연결3
40food eba588e
fix: render를 google sql에 연결4
40food b6581e2
fix: address 좁힘
40food 836bc3e
fix: proxy가 자리잡을 시간 추가
40food 6c20201
fix: 로깅 레벨 높임
40food 32cbcc0
fix: render를 google sql에 연결5
40food b8b8893
fix: 시간 다시 늘림
40food 31ad600
fix: 리뷰 반영
40food ab65cdf
Merge branch 'develop' into URECA-65/Feat/longerstt
40food File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FROM gradle:jdk17-jammy AS build | ||
| COPY --chown=gradle:gradle . /app | ||
| WORKDIR /app | ||
| RUN chmod +x gradlew | ||
| RUN ./gradlew build --no-daemon -x test # 테스트 제외로 빌드 속도 향상 | ||
|
|
||
| # ... (빌드 단계 생략: gradle:jdk17-jammy AS build 등 기존 코드 유지) | ||
|
|
||
| FROM eclipse-temurin:17-jdk-jammy | ||
| WORKDIR /app | ||
|
|
||
| # Cloud SQL Auth Proxy 설치 및 권한 설정 | ||
| ARG CLOUD_SQL_PROXY_SHA256="8c6d76380f4b7005473eb2e13991d6239f90da021cf58d91d062739479e577cf" | ||
| RUN wget -q https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.8.1/cloud-sql-proxy.linux.amd64 -O /usr/local/bin/cloud_sql_proxy && \ | ||
| echo "${CLOUD_SQL_PROXY_SHA256} /usr/local/bin/cloud_sql_proxy" | sha256sum -c - && \ | ||
| chmod +x /usr/local/bin/cloud_sql_proxy | ||
|
|
||
| COPY --from=build /app/build/libs/*.jar app.jar | ||
| COPY ./render-access.json /secrets/render-access.json | ||
| RUN chmod 400 /secrets/render-access.json | ||
|
|
||
| ENTRYPOINT ["sh", "-c", "./cloud_sql_proxy --address 127.0.0.1 --port 3306 --credentials-file /secrets/render-access.json folkloric-clock-391008:asia-northeast3:ureca-3-unity & sleep 30; java -jar app.jar"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/com/ureca/unity/domain/call/util/GcsUploader.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package com.ureca.unity.domain.call.util; | ||
|
|
||
| import com.google.auth.oauth2.GoogleCredentials; | ||
| import com.google.cloud.storage.*; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.core.io.DefaultResourceLoader; | ||
| import org.springframework.core.io.Resource; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
|
|
||
| @Slf4j | ||
| @Component | ||
| public class GcsUploader { | ||
|
|
||
| @Value("${google.cloud.project-id}") private String projectId; | ||
| @Value("${google.cloud.bucket-name}") private String bucketName; | ||
| @Value("${google.cloud.credentials.location}") private String keyPath; | ||
|
|
||
| public String uploadWav( | ||
| String objectName, | ||
| Path wavPath | ||
| ) throws Exception { | ||
| Resource resource = new DefaultResourceLoader().getResource(keyPath); | ||
| GoogleCredentials credentials = | ||
| GoogleCredentials.fromStream(resource.getInputStream()); | ||
|
|
||
| Storage storage = StorageOptions.newBuilder() | ||
| .setProjectId(projectId) | ||
| .setCredentials(credentials) | ||
| .build() | ||
| .getService(); | ||
|
|
||
| log.error("DEBUG GCS PARAMS >>> bucketName=[{}], objectName=[{}], wavPath=[{}]", | ||
| bucketName, objectName, wavPath); | ||
|
|
||
| BlobId blobId = BlobId.of(bucketName, objectName); | ||
| BlobInfo blobInfo = BlobInfo.newBuilder(blobId) | ||
| .setContentType("audio/wav") | ||
| .build(); | ||
|
|
||
| storage.create(blobInfo, Files.readAllBytes(wavPath)); | ||
|
|
||
| return "gs://" + bucketName + "/" + objectName; | ||
40food marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.