投稿時間:2021-09-14 01:34:48 RSSフィード2021-09-14 01:00 分まとめ(42件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Architecture Blog How The Mill Adventure Implemented Event Sourcing at Scale Using DynamoDB https://aws.amazon.com/blogs/architecture/how-the-mill-adventure-implemented-event-sourcing-at-scale-using-dynamodb/ How The Mill Adventure Implemented Event Sourcing at Scale Using DynamoDBThis post was co written by Joao Dias Chief Architect at The Mill Adventure and Uri Segev Principal Serverless Solutions Architect at AWS The Mill Adventure provides a complete gaming platform including licenses and operations for rapid deployment and success in online gaming It underpins every aspect of the process so that you can focus on … 2021-09-13 15:46:18
AWS AWS Compute Blog Building a serverless GIF generator with AWS Lambda: Part 2 https://aws.amazon.com/blogs/compute/building-a-serverless-gif-generator-with-aws-lambda-part-2/ Building a serverless GIF generator with AWS Lambda Part Part of this blog post expands on some of the advanced topics around scaling Lambda in parallelized workloads It explains how the asynchronous invocation mode of Lambda scales and different ways to scale the worker Lambda function 2021-09-13 15:00:18
AWS AWS Database Blog Send webhooks to SaaS applications from Amazon Aurora via Amazon EventBridge https://aws.amazon.com/blogs/database/send-webhooks-to-saas-applications-from-amazon-aurora-via-amazon-eventbridge/ Send webhooks to SaaS applications from Amazon Aurora via Amazon EventBridgeCustomers developing software as a service SaaS applications often need to send outgoing webhooks HTTP call backs in response to events to other SaaS applications such as Salesforce Marketo or ServiceNow When processing webhooks you often have to implement custom logic or services to enqueue and emit these events This introduces additional complexity and operational overhead … 2021-09-13 15:12:16
python Pythonタグが付けられた新着投稿 - Qiita スクレイピングの前提 https://qiita.com/GeekSalon_Py/items/411b98f40cccc409acec 2021-09-14 00:30:13
python Pythonタグが付けられた新着投稿 - Qiita 【Python】ターミナル上でさっとカラーコード色を確認する方法 https://qiita.com/moshi/items/10415f908928bbde3e5a 【Python】ターミナル上でさっとカラーコード色を確認する方法Pythonでターミナル上でさっとカラーコード色を確認したいな、と思うことがあったので対応ライブラリを探して試しに使ってみた。 2021-09-14 00:23:31
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScript入門(ECMAScriptモジュール③) https://qiita.com/andota05/items/3226966ab77877450853 JavaScript入門ECMAScriptモジュール③概要JavaScript入門ECMAScriptモジュール②の続きです。 2021-09-14 00:45:38
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScript入門(ECMAScriptモジュール②) https://qiita.com/andota05/items/22676d733bf1b4db9809 JavaScriptを学習、理解を深めるため「JavaScriptPrimer迷わないための入門書」を読み、理解した内容等を記載していく。 2021-09-14 00:43:54
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScript入門(ECMAScriptモジュール①) https://qiita.com/andota05/items/d91086102326b2bd3dbb エクスポートインポートの構文作成したモジュールをエクスポート、インポートして他のファイルでも利用するため、export文とimport文という種類の構文が存在する。 2021-09-14 00:41:26
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) VSCodeにてGTKのライブラリをincludePathに設定しても認識しない https://teratail.com/questions/359354?rss=all VSCodeにてGTKのライブラリをincludePathに設定しても認識しないVSCodeにてGTKのライブラリを使いたいと思い、includePathの設定にusrincludegtkを追加しました。 2021-09-14 00:47:32
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) クリックで背景適用がされない https://teratail.com/questions/359353?rss=all クリックで背景適用がされない前提・実現したいことクリックで背景に適用させたく、まとめて指定できないか試したのですが上手くいきませんでした。 2021-09-14 00:46:38
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) VBA 関数で計算式を呼び出すやり方 https://teratail.com/questions/359352?rss=all VBA関数で計算式を呼び出すやり方VBAで、足し算・引き算・掛け算・割り算の演算式を関数化したいです。 2021-09-14 00:42:00
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) C#でAtCoder online-judge-toolsでのテストのコマンドがわかりません https://teratail.com/questions/359351?rss=all CでAtCoderonlinejudgetoolsでのテストのコマンドがわかりません前提・実現したいことonlinejudgetoolsを使いAtCoderの問題をCで解くための環境を作ろうとしています。 2021-09-14 00:41:27
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Pyorch torchvision.models 転移学習 fine-tuning について https://teratail.com/questions/359350?rss=all Pyorchtorchvisionmodels転移学習finetuningについてpytorchの転移学習もしくは、finetuningは、torchvisionmodelsで用意されている学習済みモデルしか使用できないのですかもしくは、もう一度ネットワークを作りgithubnbspclone、学習済みで保存されているpklnbsppthファイルの重みを作ったネットワークに適用しながら、行うことができるのでしょうか無知で、申し訳ありません。 2021-09-14 00:40:35
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) python,pandas,pd.mergeで結合後の行が重複しているのを解消したい https://teratail.com/questions/359349?rss=all pythonpandaspdmergeで結合後の行が重複しているのを解消したいpythonでpdmergeを使ってデータ結合をしたのですが、データの行が重複してしまって、予期せぬ結合となってしまいました。 2021-09-14 00:38:53
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) javaで1~10の乱数を5つ発生させ、合計と平均を出した後に平均よりも大きい値と小さい値を表示したい https://teratail.com/questions/359348?rss=all javaでの乱数をつ発生させ、合計と平均を出した後に平均よりも大きい値と小さい値を表示したいはじめまして。 2021-09-14 00:32:47
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GETで連想配列を送りたい https://teratail.com/questions/359347?rss=all GETで連想配列を送りたい前提・実現したいことheaderquotLocationorderphpcodequotcodeこのコードを使用して連想配列をGETで送りたい発生している問題・エラーメッセージ配列の中身がArrayになってしまいます。 2021-09-14 00:32:19
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) word2vecモデルのエラー https://teratail.com/questions/359346?rss=all wordvecモデルのエラーfromgensimmodelswordvecimportWordVecmodelpathpathtowordvecgensimmodelmodelWordVecloadmodelpathこちらのサイトに載っているコードでwordvecモデルを読み込みたいのですが、AttributeErrorCantgetattributeVocabonltmodulegensimmodelswordvecfromCanacondalibsitepackagesgensimmodelswordvecpygtこのようなエラーが出てしまいます。 2021-09-14 00:31:26
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) tableタグを使った時の画像の位置などのcss調整の仕方 https://teratail.com/questions/359345?rss=all paspol 2021-09-14 00:22:07
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) reduxのconnect関数の2つ目の丸括弧は文法的にどういう意味? https://teratail.com/questions/359344?rss=all reduxのconnect関数のつ目の丸括弧は文法的にどういう意味前提・実現したいこと現在Reactの勉強をしています。 2021-09-14 00:18:40
海外TECH Ars Technica Android 12 is reportedly due out on October 4 https://arstechnica.com/?p=1794043 support 2021-09-13 15:37:45
海外TECH Ars Technica Here’s how the infrastructure bill would favor cheaper, US-made EVs https://arstechnica.com/?p=1794034 credits 2021-09-13 15:01:36
海外TECH DEV Community Creating a countdown timer RxJS vs Vanilla JS https://dev.to/jintoppy/creating-a-countdown-timer-rxjs-vs-vanilla-js-5g05 Creating a countdown timer RxJS vs Vanilla JSLet s see our requirements Create a Countdown timerstart button which will start the timer from the current stagepause button which will pause the timer so that we can resume the timer on clicking start againstop button which will stop the timer and reset the timer number Let s see how we can do with Vanilla JS lt h id result gt lt h gt lt button id startBtn gt Start lt button gt lt button id pauseBtn gt Pause lt button gt lt button id stopBtn gt Stop lt button gt Let s first select the elements and add click listenersconst startBtn document querySelector startBtn const stopBtn document querySelector stopBtn const pauseBtn document querySelector pauseBtn const result document querySelector result startBtn addEventListener click gt start the interval stopBtn addEventListener click gt stop the interval and reset value in HTML pauseBtn addEventListener click gt pause the interval We will have to create few variables to store the current valueto store the initial valueto store the interval Since we want to do an action continuously on a specific interval we will use setInterval let interval const initialValue let currentValue initialValue We will also set the current value to the HTMLresult innerHTML currentValue Now we will create the function to start the timer and call this function on click of start buttonconst startInterval gt clearInterval interval interval setInterval gt currentValue if currentValue lt currentValue initialValue clearInterval interval result innerHTML currentValue startBtn addEventListener click gt startInterval On click of stop button we will clear the interval and also reset the value stopBtn addEventListener click gt currentValue initialValue clearInterval interval result innerHTML currentValue On click of Pause button we are just clearing the interval and not resetting the value pauseBtn addEventListener click gt clearInterval interval Here is the whole code Now lets try the same with RxJSFirst same selectors againconst startBtn document querySelector startBtn const stopBtn document querySelector stopBtn const pauseBtn document querySelector pauseBtn const counterDisplayHeader document querySelector h Now lets create event streams for the button clicksconst startClick fromEvent startBtn click const stopClick fromEvent stopBtn click const pauseBtn fromEvent pauseBtn click Let s define a starting value so that countdown can start from any number defined const startValue Now the RxJS magicmerge startClick pipe mapTo true pauseBtn pipe mapTo false pipe switchMap shouldStart gt shouldStart interval EMPTY mapTo scan acc number curr number gt acc curr startValue takeWhile val gt val gt startWith startValue takeUntil stopClick repeat subscribe val gt counterDisplayHeader innerHTML val toString Let s try to breakdownFirst we will just try only the start On click of start we want to start an interval startClick pipe switchMapTo interval and we want to decrement the value by and start the value from the starting value so we will use two operators herestartClick pipe switchMapTo interval mapTo scan acc number curr number gt acc curr startValue Now we need to have option to stop the timer We want to stop the timer on two scenarios When the value reaches When user press stop buttonstartClick pipe switchMapTo interval mapTo scan acc number curr number gt acc curr startValue takeWhile val gt val gt takeUntil stopClick We want to start with a value of startValuestartClick pipe switchMapTo interval mapTo scan acc number curr number gt acc curr startValue takeWhile val gt val gt startWith startValue takeUntil stopClick Now in case of pause button click we just want to emit an empty observable pauseBtn pipe switchMapTo EMPTY Finally we want to combine both start and pause button clicks We are not really interested in event details instead we just want to decide between interval or EMPTY observable based on click So we will just map the button clicks to true or false if start button is clicked map the value to true and if pause button is clicked we map the value to false so that we can check on switchMap merge startClick pipe mapTo true pauseBtn pipe mapTo false pipe switchMap shouldStart gt shouldStart interval EMPTY And we want to start again once the timer is stopped For that we are using repeat operatorAnd you can see and play around with the whole code here So with RxJS I didn t have to create any extra external variables intervals etc Also no need to add separate logic for start stop pause Whole logic is added in a single chain of commands Isn t it neat What do you think of this Is there any better way to do this Let me know in comments const You Reader if You Fresher You Took a Break from Job if You Are Looking For A Job amp amp You Love JavaScript Click Here to know more about our Training Program 2021-09-13 15:35:06
Apple AppleInsider - Frontpage News Apple products & technologies used to drive viewer interest in Apple TV+ shows https://appleinsider.com/articles/21/09/13/apple-products-technologies-used-to-drive-viewer-interest-in-apple-tv-shows?utm_medium=rss Apple products amp technologies used to drive viewer interest in Apple TV showsA study of five popular Apple TV shows reveal over Apple products appear across episodes for some effective product placement Sam using his red iPhone in Ted Lasso Image credit AppleThe Apple TV shows studied included Ted Lasso The Morning Show Defending Jacob Trying and Mythic Quest One episode of Ted Lasso showed Apple products being used either in the foreground or background Read more 2021-09-13 15:40:43
Apple AppleInsider - Frontpage News Apple's 'flat out victory' will cause problems for antitrust regulatory efforts https://appleinsider.com/articles/21/09/13/apples-flat-out-victory-will-cause-problems-for-antitrust-regulatory-efforts?utm_medium=rss Apple x s x flat out victory x will cause problems for antitrust regulatory effortsJudge Yvonne Gonzalez Rogers ruling in the Epic vs Apple lawsuit may cause headaches for the U S government after Epic failed to prove that Apple violated antitrust laws On Friday Judge Rogers issued her ruling in Epic s lawsuit against Apple While the ruling could potentially cost Apple billions in enabling developers to advise users of third party payment methods it may have also helped Apple escape some scrutiny over other issues This includes the U S government s attempts to tempter the power of big tech companies like Apple and Google such as its June legislation package taking aim against antitrust behavior Read more 2021-09-13 15:27:00
Apple AppleInsider - Frontpage News Shazam has been used in iOS Control Center over 1 billion times https://appleinsider.com/articles/21/09/13/shazam-has-been-used-in-ios-control-center-over-1-billion-times?utm_medium=rss Shazam has been used in iOS Control Center over billion timesMusic recognition app Shazam has passed another milestone with Apple saying that its Control Center option alone being used in excess of a billion times on iOS Shazam in Control CenterApple owned Shazam passed one billion songs being recognized every month in June but now it has had that many through Control Center It was first added to Control Center as part of a beta iOS in September Read more 2021-09-13 15:21:53
Apple AppleInsider - Frontpage News Apple will break records in 2022 thanks to iPhone 13, analyst says https://appleinsider.com/articles/21/09/13/apple-will-break-records-in-2022-thanks-to-iphone-13-analyst-says?utm_medium=rss Apple will break records in thanks to iPhone analyst saysInvestment bank JP Morgan expects the iPhone lineup and an upcoming iPhone SE model to drive Apple to another record breaking fiscal year in Credit Andrew O Hara AppleInsiderIn a note to investors seen by AppleInsider JP Morgan analyst Samik Chatterjee outlines some of his expectations for Apple s Sept California Streaming event The analyst also answers some of the top questions being asked by Apple investors Read more 2021-09-13 15:11:51
Apple AppleInsider - Frontpage News Best Deals Sept. 13 - $95 4-Pack AirTags, up to 45% off Razer, and more! https://appleinsider.com/articles/21/09/13/best-deals-sept-13---95-4-pack-airtags-up-to-45-off-razer-and-more?utm_medium=rss Best Deals Sept Pack AirTags up to off Razer and more Monday s best deals include Pack AirTags off Logitech G Mechanical Gaming Keyboard up to off Razer products and more Deals Monday September Shopping online for the best discounts and deals can be an annoying and challenging task So rather than sifting through miles of advertisements check out this list of sales we ve hand picked just for the AppleInsider audience Read more 2021-09-13 15:10:51
海外TECH Engadget DC AG expands Amazon lawsuit to include wholesaler pricing tactics https://www.engadget.com/amazon-antitrust-wholesalers-attorney-general-152014125.html?src=rss DC AG expands Amazon lawsuit to include wholesaler pricing tacticsWashington DC Attorney General Karl Racine has filed an amended antitrust lawsuit against Amazon He accused Amazon of strong arming wholesalers that provide it with products into anti competitive agreements and making them subsidize lower prices Engadget has contacted Amazon for comment quot We knew Amazon was anti competitive but through our investigation we re realizing just how far it goes quot Racine wrote on Twitter The AG contends that Amazon requires a guarantee from wholesalers that it will make a minimum profit when it resells their products Those deals enable Amazon to undercut competitors pricing and force wholesalers to pay the difference for lost profit margins according to court documents obtained by The Washington Post Racine claims that prompts wholesalers to charge more for goods elsewhere to offset those payments making it more difficult for other e commerce platforms to compete against Amazon s prices PopSockets CEO David Barnett previously testified that Amazon demanded payment from the company to make up for lost profits after it reduced prices In the initial version of the suit which was filed in May Racine claimed Amazon blocks third party sellers from offering their wares at lower prices on other platforms Amazon is facing antitrust scrutiny elsewhere including from the House of Representatives the Federal Trade Commission and the European Commission Several state attorneys general are also said to be looking into whether the company has broken antitrust laws 2021-09-13 15:20:14
海外科学 NYT > Science A New Company With a Wild Mission: Bring Back the Woolly Mammoth https://www.nytimes.com/2021/09/13/science/colossal-woolly-mammoth-DNA.html A New Company With a Wild Mission Bring Back the Woolly MammothWith million in private funding Colossal aims to bring thousands of woolly mammoths back to Siberia Some scientists are deeply skeptical that will happen 2021-09-13 15:16:22
金融 RSS FILE - 日本証券業協会 J-IRISS https://www.jsda.or.jp/anshin/j-iriss/index.html iriss 2021-09-13 15:41:00
金融 金融庁ホームページ 職員を募集しています。(金融モニタリング業務に従事する職員) https://www.fsa.go.jp/common/recruit/r3/souri-07/souri-07.html Detail Nothing 2021-09-13 15:40:00
ニュース ジェトロ ビジネスニュース(通商弘報) 新型コロナ感染者増が景気拡大の足かせに、個人消費も減少、米シカゴ連銀ベージュブック https://www.jetro.go.jp/biznews/2021/09/5bbef9b1949a5e3b.html 個人消費 2021-09-13 15:40:00
ニュース ジェトロ ビジネスニュース(通商弘報) 8月の自動車生産・輸出・販売、好調維持も生産拡大に壁 https://www.jetro.go.jp/biznews/2021/09/57c037f6dafe1ae6.html 輸出 2021-09-13 15:30:00
ニュース ジェトロ ビジネスニュース(通商弘報) ウルグアイ、2国間FTA締結に向けて中国と予備調査の実施で合意 https://www.jetro.go.jp/biznews/2021/09/3cabf2e1aa94ee69.html 予備調査 2021-09-13 15:20:00
ニュース ジェトロ ビジネスニュース(通商弘報) 現代ウィア、サンクトペテルブルクにエンジン工場を開所 https://www.jetro.go.jp/biznews/2021/09/e06aeb33b38fdf28.html 現代 2021-09-13 15:10:00
ニュース BBC News - Home Covid: Single jab recommended for 12-15 year olds by UK's top doctors https://www.bbc.co.uk/news/health-58547659?at_medium=RSS&at_campaign=KARANGA disruption 2021-09-13 15:28:03
ニュース BBC News - Home TikTok star and Wales' oldest woman dies at 110 https://www.bbc.co.uk/news/uk-wales-58549830?at_medium=RSS&at_campaign=KARANGA tiktok 2021-09-13 15:09:06
ニュース BBC News - Home Felixstowe arrival of largest container ship Ever Ace caught on drone https://www.bbc.co.uk/news/uk-england-suffolk-58550645?at_medium=RSS&at_campaign=KARANGA suffolk 2021-09-13 15:16:50
サブカルネタ ラーブロ 中華そば 136@東松山(埼玉県) 「あぶらそば+ネギ、ほか」 http://feedproxy.google.com/~r/rablo/~3/cNG790pFe-0/single_feed.php 中華そば 2021-09-13 16:01:30
サブカルネタ ラーブロ Ramen DAISENMON 杯数限定の濃厚系鶏スープ http://feedproxy.google.com/~r/rablo/~3/KcR4Y_iuKNc/single_feed.php RamenDAISENMON杯数限定の濃厚系鶏スープ五泉市の「RamenDAISENMON」へと行ってきました。 2021-09-13 16:00:58
北海道 北海道新聞 がん免疫治療薬の効果が増大 ミトコンドリアの活性化で https://www.hokkaido-np.co.jp/article/588878/ 活性化 2021-09-14 00:16:00
GCP Cloud Blog Provisioning Cloud Spanner using Terraform https://cloud.google.com/blog/topics/developers-practitioners/provisioning-cloud-spanner-using-terraform/ Provisioning Cloud Spanner using TerraformOverviewCloud Spanner is a fully managed relational database built for scale with strong consistency and up to availability Key features include the following  ACID transactions SQL queries ANSI with extensions and global scale Automatic sharding optimizes performance by automatically sharding the data based on request load and size of the data Fully managed Synchronous replication and maintenance are handled automatically Flexible configurations Depending on the workload Cloud Spanner instances can be provisioned as either regional or multi regional spanning one continent or three continents Online schema Changes Cloud Spanner users can make a schema change whether it s adding a column or adding an index while serving traffic with zero downtime In this blog post we will talk about how to deploy a sample application on Cloud Run with a Cloud Spanner backend using Terraform templates We will also learn how to manage a production grade Cloud Spanner instance using Terraform by starting with a small instance and scaling up by adding more nodes or processing units Terraform for Cloud Spanner What is Terraform Terraform is a popular open source infrastructure as code tool developed by HashiCorp that provides a consistent CLI to manage hundreds of cloud services It codifies cloud APIs into declarative configuration files Terraform allows you to declare an entire GCP environment as code which can then be version controlled Benefits of using Terraform with Cloud SpannerTerraform is very useful for provisioning scalable Cloud Spanner instances and databases in real world production environments It allows for easier configuration management and version control and enables repeatability across regions and projects Organizations using Terraform to manage their cloud infrastructure today can easily include Cloud Spanner into their existing infrastructure as code framework  The Cloud Spanner with Terraform codelab offers an excellent introduction to the provisioning of instances creating and modifying databases and scaling a Cloud Spanner instance with more nodes The codelab is a great way to get started In the next few paragraphs we discuss a few details that go beyond what we cover in the codelab Specifying a regional configurationCloud Spanner instances can be launched either regionally or in a multi region Take a look at Instances in the official documentation under “regional configurations and “multi region configurations for a list of the configuration options available For regional instances add the “regional prefix to the instance names in the list below Example to provision an instance in Montreal your Terraform template will have config regional northamerica northeast screenshot from Google Cloud DocumentationFor multi region instances you can use the region name as is from the documentation Example asia for a one continent instance in Asia or nam eur asia for a three continent instance   Modifying Cloud Spanner instance propertiesNote that properties such as the amount of compute capacity via num nodes or processing units display name and labels can be modified when making changes to an existing Cloud Spanner instance via Terraform However changing the instance name the instance identifier on the GCP console will result in the cluster being destroyed and recreated As mentioned above compute capacity a k a the instance size can also be defined in terms of processing units For example the compute capacity defined below would be th of a node while a value of would be one full node Creating databases and executing DDL commandsFinally Cloud Spanner Terraform resources also support creating databases and executing DDL as part of the template  The DDL support in the Terraform resource is a useful feature for initializing a database schema for smaller applications  Limitations of Terraform with Cloud SpannerManaging database schemasDatabase schemas tend to change periodically Terraform has very limited support database schema updates changes to the DDL particularly those that are not append only will require dropping and re creating the database Therefore we don t recommend using Terraform to manage the schemas of Cloud Spanner databases Instead we recommend using a schema versioning tool like Liquibase  A Liquibase extension with Cloud Spanner support was released recently under the Cloud Spanner Ecosystem Here is the official documentation  Deploying a sample appFor demonstration purposes we re going to use a sample stock price visualization app called OmegaTrade This application stores the stock prices in Cloud Spanner and renders visualizations using Google Charts  To learn more about the app and its integration with Cloud Spanner see this blog post  Now to the fun part We will deploy this application to Cloud Run using Terraform templates We chose Cloud Run because it abstracts away infrastructure management and scales up or down automatically almost instantaneously depending on traffic Let s get started As prerequisites please ensure that you have Access to a new or existing GCP project with one of the sets of roles listed below OwnerEditor Cloud Run Admin Storage Admin Cloud Run Admin Service Usage Admin Cloud Spanner Admin Storage AdminEnabled billing on the above GCP project Installed and initialized the Google Cloud SDK Installed and configured Docker on your machine Installed and configured Git on your machine NOTE Please ensure that your permissions are not restricted by any organizational policies We are deploying this application using Cloud Shell If you are going through these steps on your local machine and assuming you have already installed the Cloud SDK you can execute the following command to authenticate gcloud auth application default loginChoose your Google account with access to the required GCP project and enter the Project ID when prompted  Next we need to ensure the gcloud configuration is set up correctly You may want to start with a new configuration by using the create command Below we are enabling authentication unsetting any API endpoint URL set previously and setting the GCP project we intend to use in the default gcloud configuration Replace Your Project ID below with the ID of your GCP project Before continuing further let s make sure our Terraform version is up to date we need Terraform version and above If needed you can go to the official Terraform download pageto download and install the latest version Next let s enable Google Cloud APIs for Cloud Spanner Container Registry and Cloud Run Note you could also use Terraform to accomplish this instead of running the commands manually Now let s clone the repository that contains Terraform modules for Cloud Run Cloud Spanner and GCE for a Cloud Spanner emulator instance which will be discussed in a future blog post  Take a look at the directory structure below  The examples folder has Cloud Spanner and Cloud Run Terraform examples with their corresponding Terraform modules located in the modules folder   Note  By default we have defined the compute capacity in terms of number of nodes in these templates In case you want to define your compute capacity using processing units instead of nodes you will need to uncomment the lines of code for processing units in each of the examples and modules and comment out the corresponding lines for num nodes The two options are mutually exclusive To find all the relevant files to modify you can executeNote that as of the time of this writing the smallest compute capacity available is processing units or th of a node Launch Cloud Spanner We will now launch a single node Cloud Spanner instance in the us west region The template also creates a database and the necessary tables for the OmegaTrade application using the DDL specified in the template Take a look at the terraform tfvars file to customize the compute capacity region and number of nodes or processing units  Enter your GCP project ID without the square brackets make any other changes you d like and save In case you want to define your compute capacity using processing units instead of nodes you can specify a value for spanner processing units instead of spanner nodes and follow the instructions at the end of the previous section  Next let s initialize Terraform and make sure that we have the correct versions of the providers installedAnalyze the execution plan And apply the changes Terraform will ask for your confirmation before applying You should see the Cloud Spanner instance successfully provisioned Click into the hamburger menu at the top left and select Spanner to verify the outcome on the GCP console  You can find the instance and database created along with the necessary tables for the OmegaTrade application  The above example provisioned a single node instance in the us west region If you would like to launch in a different region different instance configuration with multiple nodes simply edit the terraform tfvars file and set a different instance configuration instead of spanner config regional us west   Deploying the backend to Cloud RunWe are going to be deploying two different services to Cloud Run omegatrade frontendand omegatrade backend NOTE Please ensure that your permissions are not restricted by any organizational policies or you may run into an IAM related issue at the apply stage later on Now that the Cloud Spanner instance database and tables are in place let s build and deploy the backend service to Cloud Run The frontend has a dependency on the backend URL so we will start with the backend In the backend folder we will create a env file and insert some seed data into the database we created in the previous section We begin by setting the gcp project id spanner instance id and spanner database id to the appropriate values that we got from the GCP console omitting the square brackets Then we run the following command to populate the seed data Next we build the image from the dockerfile and push it to GCR We will change the commands below to reflect our GCP project ID and run them We will now go back to the Terraform examples directory and provision the backend service of the OmegaTrade application Like the Cloud Spanner example you have seen in the previous section you can quickly edit the terraform tfvars file to make changes according to your environment and deploy  Since the Terraform template adds a suffix to the instance name and DB name you might want to get the exact instance name and database name from the GCP console The backend container image path is the same path that you used in the docker push command above NOTE In these templates we follow the standard practice of using variables tf or tfvars files to define variables and values This is particularly useful when we have multiple resources with similar configuration as while upgrading them the values need to be changed in only one place Here is how my file looks with all the details except the project ID filled in Next let s initialize Terraform and validate the plan Now we re ready to deploy backend service If you get an IAM related error at this stage it is likely because of an organizational policy of the organization that the project is hosted in You may need to contact your organization admin or start over with a project in a different organization that does not have this restriction Terraform will ask for your confirmation before applying  You should now see the backend service up and running Check Cloud Run in the GCP console and locate the new service  Write down its URL We will use it in the frontend configuration in the next section  Deploying the frontend to Cloud RunBefore we build the frontend service we need to update the following file from the repo with the backend URL we got from the above step  Change the base URL to the backend URL noted down in the previous section In the frontend folder build the frontend service and push the image to GCR Go to the Terraform example for CloudRun frontend service We will now provision the frontend service using the image we pushed to GCR above Open the terraform tfvars file and add the GCP project ID and frontend image path Here is what the file should look like after filling in most of the details Now let s deploy the frontend service Once again Terraform will ask for your confirmation before applying  You should now see the frontend service up and running Check the services on the GCP console You will now be able to go to the frontend URL and interact with the application You can interact with existing visualizations or simulate write activity on Cloud Spanner by visiting the Manage Simulations view in the application Choose an existing company or add a new company and choose an interval and number of records  Scaling Cloud Spanner using TerraformTo scale the Cloud Spanner instance up or down go back to the Cloud Spanner Terraform examples folder We currently have a single node Cloud Spanner instance in the us west region For production environments this configuration may not be sufficient Scaling Cloud Spanner can be achieved using our Terraform template Take a look at the terraform tfvars file We chose a regional instance with node during the initial provisioning running in the us west region We can now scale Cloud Spanner to the compute capacity necessary by running a terraform apply once again with an updated node count   An example tfvars file to scale the instance is available as terraform scale tfvars as shown below Specify the same instance ID and database name as initially used Note that the Terraform template randomizes the names of the instance and database by adding a random suffix but while scaling you just need to use the original names  Edit the terraform scale tfvars file with your project IDIn case you defined your compute capacity using processing units instead of nodes you can follow the same steps to resize it by specifying an updated value for spanner processing units instead of spanner nodes and commenting uncommenting the appropriate lines in the script as noted just above the Launch Cloud Spanner section earlier in this post Apply changes to scale the instance from node to nodes It may take a few seconds for the changes to take effect  Verify the changes on the GCP consoleConclusionWe have seen how easy it is to provision Cloud Spanner instances and create databases and tables using Terraform using a sample application deployment We have also seen how to scale Cloud Spanner using Terraform after the initial deployment Armed with this knowledge you are ready to try out the code modules in this repository and set up your own Cloud Spanner instances with Terraform To learn more about using Terraform with Cloud Spanner visitThe Cloud Spanner documentationThe Terraform documentationThe Terraform with Cloud Spanner CodelabThe Google Cloud Platform Terraform repository on GitHubRelated ArticleMeasuring Cloud Spanner performance for your workloadIn this post we will explore a middle ground to performance testing using JMeter Performance test Cloud Spanner for a custom workload b Read Article 2021-09-13 15:30:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)