Develop/DevOps

[Intellij] GCP Plugin - Cloud Code 사용하기 in GCS | [Intellij] GCP Plugin - Using Cloud Code in GCS

GCP Storage를 연동하여 사용하는 글을 블로그에 포스팅하려고 Spring initializer을 이용해서 프로젝트를 생성하면서 좋은 플러그인을 발견하여 기록하려 한다.위와 같은 dependency로 새로운 프로젝트를 설정하니, Cloud Code라는plugin 추천이 떠서 받아보았다.Google에서 개발한 플러그인으로, Stackdriver Debugger와 통합되서 GCP에서 실행되는 프로덕션 애플리케이션을 intellij에서 디버깅할 수 있다. 특히 Stackdriver Debugger를 사용하면 Stackdriver Debugger를 사용하면 Compute Engine과 App Engine 표준 환경 및 가변형 환경 모두에 배포된 자바 애플리케이션을 디버깅할 수 있다. 또한 App Engin..

[Intellij] GCP Plugin - Cloud Code 사용하기 in GCS | [Intellij] GCP Plugin - Using Cloud Code in GCS

728x90

GCP Storage를 연동하여 사용하는 글을 블로그에 포스팅하려고 Spring initializer을 이용해서 프로젝트를 생성하면서 좋은 플러그인을 발견하여 기록하려 한다.

Initializer에 Google Cloud Platform 관련 dependency를 추가할 수 있다.

위와 같은 dependency로 새로운 프로젝트를 설정하니, Cloud Code라는plugin 추천이 떠서 받아보았다.

Google에서 개발한 플러그인으로, Stackdriver Debugger와 통합되서 GCP에서 실행되는 프로덕션 애플리케이션을 intellij에서 디버깅할 수 있다. 특히 Stackdriver Debugger를 사용하면 Stackdriver Debugger를 사용하면 Compute Engine과 App Engine 표준 환경 및 가변형 환경 모두에 배포된 자바 애플리케이션을 디버깅할 수 있다. 또한 App Engine 환경 배포를 직접 IDE에서 할 수 있는 장점도 있다.

인텔리제이의 Preference [ ⌘ + , ] > Plugins > clod code 를 입력해서 설치할 수 있고, 설치가 완료될 경우 intellij를 restart 해야 플러그인을 적용할 수 있다.

https://cloud.google.com/code/docs/intellij/how-to

 

안내 가이드  |  IntelliJ용 Cloud Code  |  Google Cloud

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trade

cloud.google.com

설명서를 읽어보니 Intellij가 아니더라도 JetBrains 의 여러 IDE에서 가능했다. 다만 Intellij에 최적화된 플러그인이다.

PyCharm / WebStorm / PhpStorm / Rider / RubyMine / GoLand / AppCode / CLion

또한 Cloud code에서 제공하는 Google Cloud Platform에서 지원되는 프로덕트 리스트는 총 6개로 아래와 같으며 개요를 읽어보니 Kubernetes 개발, 배포에서의 편리성이 가장 큰 장점인 듯하다.
근데 나는 Storage 작업을 할 건데,, 여튼 저튼 쨋든

1. Kubernetes : 애플리케이션 만들기, 애플리케이션 배포
2. App Engine : 애플리케이션 만들기 (가변, 표준)
3. Cloud API 및 GCP 라이브러리 관리
4. Cloud Storage : 버킷 안 콘텐츠 탐색
5. Cloud Source Repositories
6. Stackdriver Debugger : logging

storage 연동 첫 시작

플러그인 설치를 완료하면 인텔리제이 우측 바에 google cloud storage, kubernetes Explorer 탭이 생기게 되는데,
현재 내가 개발할 프로젝트는 cloud storage와 관련된 것이라, storage 탭에 대해 알아보려 한다.

storage에 대한 정보를 얻어오려면 GCP의 project를 가져와야 하기 때문에, 그 프로젝트의 권한을 가진 account로 로그인을 진행해준다.
로그인 버튼을 누르면 왼쪽 아래 그림과 같이 로그인 창이 뜨고 허용을 눌러주면 된다.

그리고 다시 Google Cloud Storage 탭으로 돌아와서 project를 선택해주면 되는데, 내가 현재 선택한 account가 권한을 가진 프로젝트 리스트들이 보이므로, storage를 사용할 project를 선택한다. 

나는 daily-commit이라는 개인 프로젝트를 선택하였다. 이렇게 간단하게 연동이 마무리된다.
따로 console.cloud web을 통해 bucket안에 들어있는 파일, 폴더를 찾아보지 않아도, 개발하는 IDE 안에서 볼 수 있다는 장점이 있다.

나는 프로젝트에 두 개의 bucket을 만들었고, ewha-commiters-static-file이라는 버킷 안에 여러 폴더 + 파일들을 저장해둔 상태이다.
이런 내용을 기존에 GCP console Web을 이용해서 봤다면, 플러그인을 이용해서

아래와 같이 Intellij IDE 안에서 bucket안에 있는 파일의 내용을 확인할 수 있다.

다만 아쉬운 게 있다면, Web GCP Console에서는 파일의 URL 및 다운로드 경로도 알 수 있었는데, plugin에서는 지원하지 않는다.
우클릭을 하면 아래와 같이 blob name과 bucket name을 복사할 수 있는데, 이를 이용해서 수제로 URL, 다운로드 경로를 만들어주자.

URL : gs://[bucket-name]/[blob-name]
링크 URL : https://storage.cloud.google.com/[bucket-name]/[blob-name]?authuser=0

 

storage 버켓 확인은 이 플러그인을 효과적으로 사용하는 것 같지 않아서, 다음번엔 Stackdriver의 log를 플러그인을 통해서 확인하는 방법을 찾아봐야겠다. 

I was about to write a blog post about integrating GCP Storage, and while creating a project using Spring Initializer, I discovered a nice plugin that I wanted to document.

You can add Google Cloud Platform related dependencies in the Initializer.

When I set up a new project with the dependencies shown above, a plugin recommendation for Cloud Code popped up, so I gave it a try.

It's a plugin developed by Google that integrates with Stackdriver Debugger, allowing you to debug production applications running on GCP directly from IntelliJ. In particular, with Stackdriver Debugger, you can debug Java applications deployed on both Compute Engine and App Engine standard and flexible environments. It also has the advantage of letting you deploy to App Engine environments directly from the IDE.

You can install it by going to IntelliJ's Preferences [ ⌘ + , ] > Plugins > and searching for "cloud code." Once the installation is complete, you need to restart IntelliJ to apply the plugin.

https://cloud.google.com/code/docs/intellij/how-to

 

How-to Guides  |  Cloud Code for IntelliJ  |  Google Cloud

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trade

cloud.google.com

After reading the documentation, I found out it works not only with IntelliJ but also with several other JetBrains IDEs. However, it is optimized for IntelliJ.

PyCharm / WebStorm / PhpStorm / Rider / RubyMine / GoLand / AppCode / CLion

Also, Cloud Code supports a total of 6 Google Cloud Platform products as listed below. After reading the overview, it seems like the biggest advantage is the convenience in Kubernetes development and deployment.
But I'm just going to work with Storage, so... anyway, moving on.

1. Kubernetes : Create applications, deploy applications
2. App Engine : Create applications (flexible, standard)
3. Cloud API and GCP library management
4. Cloud Storage : Browse contents within buckets
5. Cloud Source Repositories
6. Stackdriver Debugger : logging

Getting started with Storage integration

Once the plugin installation is complete, you'll see Google Cloud Storage and Kubernetes Explorer tabs appear on the right sidebar of IntelliJ.
Since the project I'm currently working on is related to Cloud Storage, I'm going to look into the Storage tab.

To retrieve information about storage, you need to fetch the GCP project, so you'll need to log in with an account that has permissions for that project.
When you click the login button, a login window like the one on the left below will appear — just click "Allow."

Then go back to the Google Cloud Storage tab and select your project. You'll see a list of projects that your currently selected account has permissions for, so just pick the project you want to use with Storage. 

I selected my personal project called "daily-commit." And just like that, the integration is done.
The nice thing is that you don't have to go through console.cloud web to look for files and folders inside your buckets — you can see them right inside the IDE where you're developing.

I created two buckets in my project and have stored several folders and files inside a bucket called "ewha-commiters-static-file."
If you used to check this kind of stuff through the GCP Console Web, now you can use the plugin instead.

As shown below, you can view the contents of files inside a bucket right within the IntelliJ IDE.

One downside though — in the Web GCP Console, you could see the file's URL and download path, but the plugin doesn't support that.
If you right-click, you can copy the blob name and bucket name as shown below. You can use these to manually construct the URL and download path.

URL : gs://[bucket-name]/[blob-name]
Link URL : https://storage.cloud.google.com/[bucket-name]/[blob-name]?authuser=0

 

Checking storage buckets doesn't seem like the most effective use of this plugin, so next time I should look into how to check Stackdriver logs through the plugin. 

댓글

Comments

Daily/Code Fest

Google Cloud OnBoard 후기 & 정리본 링크 | Google Cloud OnBoard Review & Summary Notes Link

2019년 11월 26일 세종대학교에서 열린 Google Cloud OnBoard에 다녀왔습니다.11월 초 summit에 다녀오긴 했는데 실제로 핸즈온 세션이 열린다고 해서 갔다왔습니다. https://inthecloud.withgoogle.com/onboard-global/core-ko-register.html?utm_content=summit-invite&utm_source=summit&utm_medium=event&utm_campaign=FY19-Q4-apac-onboard-operational-er-KROnBoardSeoul_EV_summit Cloud OnBoardCloud OnBoard is a free, instructor-led training event, that gives you a h..

Google Cloud OnBoard 후기 & 정리본 링크 | Google Cloud OnBoard Review & Summary Notes Link

728x90

2019년 11월 26일 세종대학교에서 열린 Google Cloud OnBoard에 다녀왔습니다.

11월 초 summit에 다녀오긴 했는데 실제로 핸즈온 세션이 열린다고 해서 갔다왔습니다.

 

https://inthecloud.withgoogle.com/onboard-global/core-ko-register.html?utm_content=summit-invite&utm_source=summit&utm_medium=event&utm_campaign=FY19-Q4-apac-onboard-operational-er-KROnBoardSeoul_EV_summit

 

Cloud OnBoard

Cloud OnBoard is a free, instructor-led training event, that gives you a headstart on your journey to developing on Google Cloud Platform (GCP).

inthecloud.withgoogle.com

 

요약하자면 기대와는 다르게 핸즈온 세션보다 그냥 듣는 세미나가 더 길었는데, 그래도 학교를 빠지고 하루를 투자해서 갔다온 행사였어서 최대한 여기에서의 정보를 활용할 수 있는 방법을 고민하다가 결국 블로그 포스팅을 하게되었습니다.

 

1. 자료집 워드본

나눠준 자료집을 한번 워드로 옮기면서 머리속에 어떤 제품이 있는지 메모해두고, 앞으로 백엔드 개발하면서 제 글을 참고해서 인프라 구축할 때 도움이 될 것 같아서 정리한 링크는 아래와 같습니다.

 

https://jyami.tistory.com/28

 

[Cloud OnBoard] 1 - Google Cloud Platform 소개

2019년 11월 26일 세종대학교에서 있었던 Google Cloud OnBoard에서 나누어준 자료집의 정리본입니다 모듈1 Google Cloud Platform 소개 0. 추가 자료 GCP를 선택해야하는 이유 : https://cloud.google.com/why-go..

jyami.tistory.com

 

https://jyami.tistory.com/29

 

[Cloud OnBoard] 2 - 가상머신 및 스토리지

2019년 11월 26일 세종대학교에서 있었던 Google Cloud OnBoard에서 나누어준 자료집의 정리본입니다 모듈2 가상머신 및 스토리지 0. 추가 자료 Google Compute Engine : https://cloud.google.com/compute/docs G..

jyami.tistory.com

https://jyami.tistory.com/30

 

[Cloud OnBoard] 3 - 컨테이너 및 앱 개발, 배포, 모니터링

2019년 11월 26일 세종대학교에서 있었던 Google Cloud OnBoard에서 나누어준 자료집의 정리본입니다 모듈3 컨테이너 및 앱 개발, 배포, 모니터링 0. 추가자료 Kubernetes Engine : https://cloud.google.com/kube..

jyami.tistory.com

https://jyami.tistory.com/31

 

[Cloud OnBoard] 4 - 빅데이터 및 머신러닝

2019년 11월 26일 세종대학교에서 있었던 Google Cloud OnBoard에서 나누어준 자료집의 정리본입니다 모듈4 빅데이터 및 머신러닝 0. 추가자료 Google 빅데이터 플랫폼 : https://cloud.google.com/products/big-d..

jyami.tistory.com

 

2.  행사

행사 자체는 Summit하고 굉장히 비슷했어요 GCP에 대한 전반적인 소개, 각 제품의 특징을 소개하는 세미나로 이루어 졌습니다.

그래도 중간에 quiklab 쿠폰이나 Coursera 쿠폰을 주셔서 줍줍 했네요ㅋㅋ

 

행사장 가는길 그리고 기념품

이번 행사는 끝나면 Cloud 팝소켓을 주더라구요! 수료증도 준다고 해서, 학교 빠진 것때문에 끝까지 앉아있다 왔습니다.

 

Google Cloud 행사에는 항상 게임기가 있네요ㅋㅋ

세션에 대한 정리는 위를 참고하시면 될 것 같구요.

사실 핸즈온 세션의 비중이 높은줄 알고왔지만 세션이 다 끝나고 있던 클라우드 히어로가 아무래도 직접 킥랩을 풀어보는 세션이라 그런지 가장 기억에 남네요

 

Google Cloud Platform 과 관련해서 문제를 푸는거였는데요 킥랩을 얼마나 많이 빨리 푸느냐에 따라 점수가 달라졌습니다. 아무래도 저는 GCP를 접한지 얼마 안되서 1번 2번을 풀다가 그만 했어요ㅋㅋ 3번은 kubernetes를 내 킥랩계정에 설정하는거였는데 kubernetes까지는 어렵더군요!

그래서 약 1시간동안 다같이 cloud hero문제를 풀고 1등부터 10등까지 랭킹에 드신분들에게는 히어로 망토랑 cloud 백팩을 주셨습니다!

 

근데 행사 당시 아무래도 인원이 많아서 그런지 인터넷도 너무 안좋았고, Gshell도 갑자기 너무 많은 요청이 들어와서 그런지 프로비저닝이 끝나지 않아서ㅠㅠㅠ 기다리던 시간이 조금 많았는데, 

만약 제가 정말 GCP를 잘아는 사람이라서 망토를 노릴 정도였다면 많이 아쉬웠을 것 같아요.

 

3. 세미나 요약 표!

그래서 아무래도 전체 행사가 세미나로 이루어져 있다보니까 집에 돌아와서 세미나내용이라도 얼추 제대로 읽어보기라도 하자 생각해서 하게된게 블로그 포스팅이었습니다ㅋㅋ

 

온보딩에 못가서 어떤걸 했는지 아쉬웠던 분들은 참고 하시면 좋을 것 같아요

 

1. 컴퓨팅 옵션 비교

2. 부하 분산 옵션 비교

3. 상호 연결 옵션 비교

4. 스토리지 옵션 비교

5. Google Cloud Storage 클래스 중에서 선택하기

On November 26, 2019, I attended Google Cloud OnBoard held at Sejong University.

I had already been to the summit in early November, but I went again because they said there would be hands-on sessions.

 

https://inthecloud.withgoogle.com/onboard-global/core-ko-register.html?utm_content=summit-invite&utm_source=summit&utm_medium=event&utm_campaign=FY19-Q4-apac-onboard-operational-er-KROnBoardSeoul_EV_summit

 

Cloud OnBoard

Cloud OnBoard is a free, instructor-led training event, that gives you a headstart on your journey to developing on Google Cloud Platform (GCP).

inthecloud.withgoogle.com

 

To sum it up, contrary to my expectations, the seminar portion was longer than the hands-on sessions. Still, since I skipped school and invested a whole day to attend this event, I was thinking about how to make the most of the information I got — and that's how I ended up writing this blog post.

 

1. Handout Material — Word Transcription

I transferred the handout materials into a Word document to keep a mental note of what products are available. I figured it would come in handy as a reference when setting up infrastructure for backend development in the future. Here are the organized links:

 

https://jyami.tistory.com/28

 

[Cloud OnBoard] 1 - Introduction to Google Cloud Platform

This is a summary of the handout materials from Google Cloud OnBoard held at Sejong University on November 26, 2019. Module 1: Introduction to Google Cloud Platform. 0. Additional Resources. Why choose GCP: https://cloud.google.com/why-go..

jyami.tistory.com

 

https://jyami.tistory.com/29

 

[Cloud OnBoard] 2 - Virtual Machines and Storage

This is a summary of the handout materials from Google Cloud OnBoard held at Sejong University on November 26, 2019. Module 2: Virtual Machines and Storage. 0. Additional Resources. Google Compute Engine: https://cloud.google.com/compute/docs G..

jyami.tistory.com

https://jyami.tistory.com/30

 

[Cloud OnBoard] 3 - Containers, App Development, Deployment, and Monitoring

This is a summary of the handout materials from Google Cloud OnBoard held at Sejong University on November 26, 2019. Module 3: Containers, App Development, Deployment, and Monitoring. 0. Additional Resources. Kubernetes Engine: https://cloud.google.com/kube..

jyami.tistory.com

https://jyami.tistory.com/31

 

[Cloud OnBoard] 4 - Big Data and Machine Learning

This is a summary of the handout materials from Google Cloud OnBoard held at Sejong University on November 26, 2019. Module 4: Big Data and Machine Learning. 0. Additional Resources. Google Big Data Platform: https://cloud.google.com/products/big-d..

jyami.tistory.com

 

2.  The Event

The event itself was very similar to the Summit. It consisted of seminars that gave a general overview of GCP and introduced the features of each product.

But they did give out Qwiklabs coupons and Coursera coupons during the event, so I snagged those lol

 

On the way to the venue, and the swag

At this event, they gave out Cloud PopSockets when it was over! They also said they'd give out certificates of completion, so since I had already skipped school for this, I stayed until the very end.

 

There's always an arcade machine at Google Cloud events lol

You can refer to the links above for the session summaries.

I actually came expecting a heavy focus on hands-on sessions, but the Cloud Hero activity at the end — where you actually solve Qwiklabs challenges yourself — ended up being the most memorable part.

 

It was about solving problems related to Google Cloud Platform, and your score depended on how many Qwiklabs challenges you solved and how fast. Since I was pretty new to GCP, I only managed to solve problems 1 and 2 before calling it quits lol. Problem 3 was about setting up Kubernetes on your Qwiklabs account, and that was just too hard for me!

So after about an hour of everyone solving Cloud Hero challenges together, the top 10 ranked participants received hero capes and Cloud backpacks!

 

But since there were so many people at the event, the internet was really bad, and Google Cloud Shell seemed overwhelmed by all the requests — provisioning just wouldn't finish 😭😭😭 There was quite a bit of waiting around.

If I had actually been someone who knew GCP well enough to compete for the cape, I would've been pretty frustrated.

 

3. Seminar Summary Charts!

Since pretty much the entire event was seminars, I came home thinking I should at least properly read through the seminar content — and that's what led me to write this blog post lol

 

If you missed the onboarding event and were curious about what was covered, hopefully this will be helpful!

 

1. Comparing Compute Options

2. Comparing Load Balancing Options

3. Comparing Interconnect Options

4. Comparing Storage Options

5. Choosing Among Google Cloud Storage Classes

댓글

Comments