GCP

Google Cloud Shell ๊ฐ„๋‹จ ์‚ฌ์šฉ๋ฒ•

whistory 2023. 2. 10. 16:39
๋ฐ˜์‘ํ˜•

๐Ÿ’กGoogle Cloud Platform ์—์„œ Cloud Shell ์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณธ๋‹ค.

 

 

BigQuery ์ด๊ด€์„ ์œ„ํ•ด, Python ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ด์•ผ ํ–ˆ๋‹ค.

 

 

์ฝ˜์†”์˜ ์šฐ์ธก์ƒ๋‹จ์˜ ๋ฒ„ํŠผ์„ ํ†ตํ•ด ์ ‘๊ทผํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๊ณ ,

 

์„œ๋น„์Šค ๊ฒ€์ƒ‰์„ ํ†ตํ•ด ์ ‘๊ทผํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค.

 

 

 

VScode๋ฅผ ์‚ฌ์šฉํ•ด ๋ดค์œผ๋ฉด, ์ต์ˆ™ํ•œ ํ™”๋ฉด์ผ ๊ฒƒ์ด๋‹ค.

 

 

ํ„ฐ๋ฏธ๋„์„ ํ†ตํ•ด ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•˜๊ณ .

 

์ƒ์„ฑํ•œ ํด๋”๋ฅผ ์—ฐ๋‹ค.

 

 

 

New File๋กœ ์‹คํ–‰ํ•  Python ํŒŒ์ผ์„ ์ƒ์„ฑํ•œ๋‹ค.

 

 

 

์‹คํ–‰ํ•  python ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜๊ณ , ์‹คํ–‰ํ•˜๋Š” ํ˜•์‹์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

 

 

 

ํ„ฐ๋ฏธ๋„์„ ๋ณด๋ฉด, ๋…ธ๋ž€์ƒ‰ ๊ด„ํ˜ธ๊ฐ€ ๋ณด์ธ๋‹ค.

ํ˜„์žฌ Cloud Shell ์„ ์‹คํ–‰ํ•œ ํ”„๋กœ์ ํŠธ๊ฐ€ ์ข…์†๋˜์–ด ํ‘œ์‹œ๋œ๋‹ค.

 

ํ”„๋กœ์ ํŠธ๋ฅผ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

 

 

๊ณ„์ •์— ํ• ๋‹น๋œ ํ”„๋กœ์ ํŠธ ๋ฆฌ์ŠคํŠธ ํ™•์ธ

wsseo@cloudshell:~ (testProeject_1)$ gcloud projects list
PROJECT_ID: testProeject_1
NAME: testProeject_1
PROJECT_NUMBER: 111111111111

PROJECT_ID: testProeject_2
NAME: testProeject_2
PROJECT_NUMBER: 222222222222

PROJECT_ID: testProeject_3
NAME: testProeject_3
PROJECT_NUMBER: 333333333333

wsseo@cloudshell:~ (testProeject_1)$

ํ”„๋กœ์ ํŠธ ๋ณ€๊ฒฝ

wsseo@cloudshell:~ (testProeject_1)$ gcloud config set project testProeject_2
Updated property [core/project].

wsseo@cloudshell:~ (testProeject_2)$

 

ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์˜ Bigquery dataset ํ™•์ธ

wsseo@cloudshell:~ (testProeject_2)$ gcloud alpha bq datasets list
ID: testProeject_2:dataset_1
LOCATION: asia-northeast3

ID: testProeject_2:dataset_2
LOCATION: asia-northeast3

 

๋ฐ˜์‘ํ˜•