45. Rust
Teams
Toolkit
Deploy Teams apps
with Microsoft Graph,
and in Azure and M365
Azure Static
Web Apps
Create and manage
Azure Static Web Apps directly
Remote
Development
Remote SSH
Remote Containers
Remote WSL
Docker
Containerization tool
Language support
Thunder
Client
API Client Extention
Visual Studio Code Extensionsの準備
MongoDB for
VS Code
for working with MongoDB,
whether your own instance or in
MongoDB Atlas.
Microsoft.AspNetCore.R
azor.VSCode.BlazorWas
mDebuggingExtension
Version 1.23.9以上の場合
60. — docker founder :
Solomon Hykes
“If WASM+WASI existed in 2008, we wouldn't
have needed to created Docker. That's how
important it is. Webassembly on the server is
the future of computing. A standardized
system interface was the missing link. Let's
hope WASI is up to the task!”
“2008年にWASM + WASIが存在していれば、
Dockerを作成する必要はありませんでした。それがど
れほど重要かです。サーバー上のWebAssemblyは、
コンピューティングの未来です。”
Docker Birthday #3: docker blog
tweet of Solomon Hykes
83. CRÉDITOS: este modelo de apresentação
foi criado pelo Slidesgo, inclui ícones da
Flaticon e infográficos e imagens da
Freepik
Thank you
今後ともよろしくお願いします。
tetsuro.takao@processtune.com
mvp.microsoft.com/en-us/PublicProfile/4029060
blog.processtune.com
83
84. Link
● slidesgo : 本プレゼンテーションのテンプレートWebサイト(本プレゼンテーションのURL)
https://slidesgo.com/ (theme/eu-energy-strategy-business-meeting#search-space&position-2&results-73)
● GraalVM
https://www.graalvm.org/
● Install Docker CE on Ubuntu 20.04
https://lindevs.com/install-docker-ce-on-ubuntu/
● Differences between GitHub Apps and OAuth Apps
https://docs.github.com/en/developers/apps/getting-started-with-apps/differences-between-github-apps-and-oauth-apps
● pksunkara/octonode
https://github.com/pksunkara/octonode
● Installing gh on Linux and BSD
https://github.com/cli/cli/blob/trunk/docs/install_linux.md
● A Possible New Backend for Rust
https://jason-williams.co.uk/a-possible-new-backend-for-rust
● EJS
https://ejs.co/
● pug
https://pugjs.org/api/getting-started.html
● Handlebars
https://jason-williams.co.uk/a-possible-new-backend-for-rust
86. slidesgo : 本プレゼンテーションのテンプレートWebサイト(本プレゼンテーションのURL)
https://slidesgo.com/ (theme/eu-energy-strategy-business-meeting#search-space&position-2&results-73)
Cloud Native Computing Foundation (CNCF) :
https://www.cncf.io/
Introducing gRPC, a new open source HTTP/2 RPC Framework :
https://developers.googleblog.com/2015/02/introducing-grpc-new-open-source-http2.html
Announcing HTTP/2 support in Azure App Service :
https://azure.microsoft.com/ja-jp/blog/announcing-http-2-support-in-azure-app-service/
WHATWG :
https://whatwg.org/
The LLVM Compiler Infrastructure :
https://llvm.org/
llvm-project : GitHub
https://github.com/llvm/llvm-project
Configure options for the ASP.NET Core Kestrel web server :
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/options?view=aspnetcore-5.0#http2-limits
WebSocket :
https://docs.microsoft.com/ja-jp/windows/uwp/networking/websockets
Azure Web PubSub :
https://azure.microsoft.com/en-us/services/web-pubsub/
Reference Links 1
87. Azure SignalR サービスとは :
https://docs.microsoft.com/ja-jp/azure/azure-signalr/signalr-overview
Cloud Native Apps (monthly resource) :
https://github.com/microsoft/monthlyresources/?ocid=AID303759
HTTP/2 in Windows 10: Browser, Apps and Web Server :
https://channel9.msdn.com/Events/Build/2015/3-88
Server Events :
https://docs.servicestack.net/server-events#server-event-clients
Azure Web PubSub Serviceを触ってみた :
https://www.slideshare.net/ssuser293809/azure-web-pubsub-service
Microservices and the First Law of Distributed Objects :
https://martinfowler.com/articles/distributed-objects-microservices.html
OASIS Message Queuing Telemetry Transport (MQTT) TC :
https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=mqtt
Use streaming in ASP.NET Core SignalR :
https://docs.microsoft.com/en-us/aspnet/core/signalr/streaming?view=aspnetcore-5.0
Azure Web PubSub : GitHub
https://github.com/Azure/azure-webpubsub
gRPC services with ASP.NET Core : Visual Studio
https://docs.microsoft.com/en-us/aspnet/core/grpc/aspnetcore?view=aspnetcore-5.0&tabs=visual-studio
Reference Links 2
88. High-performance Services with gRPC: What's new in .NET 5 :
https://channel9.msdn.com/events/dotnetConf/2020/High-performance-Services-with-gRPC-Whats-new-in-NET-
5?term=gRPC%20HTTP2&pubDate=year&lang-ja=true&lang-en=true
gRPC Web with .NET :
https://channel9.msdn.com/Shows/On-NET/gRPC-Web-with-NET?term=gRPC%20HTTP2&pubDate=year&lang-
en=true&pageSize=15
.NET Core での gRPC のトラブルシューティング :
https://docs.microsoft.com/ja-jp/aspnet/core/grpc/troubleshoot?view=aspnetcore-5.0
APACHE KAFKA :
https://kafka.apache.org/
Quickstart: Create a serverless simple chat application with Azure Functions and Azure Web PubSub service :
https://docs.microsoft.com/en-us/azure/azure-web-pubsub/quickstart-serverless?tabs=javascript
NET での gRPC でサポートされているプラットフォーム :
https://docs.microsoft.com/ja-jp/aspnet/core/grpc/supported-platforms?view=aspnetcore-5.0
Cloud Endpoints for gRPC :
https://cloud.google.com/endpoints/docs/grpc/about-
grpc#:~:text=gRPC%20is%20a%20high%20performance,create%20distributed%20applications%20and%20services.
Using Docker in WSL 2 :
https://code.visualstudio.com/blogs/2020/03/02/docker-in-wsl2
docker docs :
https://docs.docker.com/
Reference Links 3
89. How to Deal with Lock Holder Preemption :
https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.369.9589&rep=rep1&type=pdf
Steve Jobs, 1955-2011 :
https://www.theverge.com/2011/10/05/steve-jobs-1955-2011-2
Linux Kernel 5.15 Released with New NTFS File System, In-Kernel SMB Server, and More :
https://9to5linux.com/linux-kernel-5-15-released-with-new-ntfs-file-system-in-kernel-smb-server-and-more
Xerox Corp. v. Apple Computer, Inc., 734 F. Supp. 1542 (N.D. Cal. 1990) :
https://law.justia.com/cases/federal/district-courts/FSupp/734/1542/1461830/
Apple Computer Inc. v. Microsoft Corp., 759 F. Supp. 1444 (N.D. Cal. 1991) :
https://law.justia.com/cases/federal/district-courts/FSupp/759/1444/1472666/
Inflation Calculator :
https://www.in2013dollars.com/us/inflation/1997?amount=1
U.S. Dollar to Japanese Yen Spot Exchange Rates for 1997 from the Bank of England :
https://www.poundsterlinglive.com/bank-of-england-spot/historical-spot-exchange-rates/usd/USD-to-JPY-1997
Information Anxiety 2 (Hayden/Que) 2nd Edition :
https://www.amazon.com/Information-Anxiety-2-Hayden-
Que/dp/0789724103/ref=sr_1_1?ie=UTF8&qid=1341674668&sr=8-1&keywords=Information+Anxiety+2
それは「情報」ではない。―無情報爆発時代を生き抜くためのコミュニケーション・デザイン :
Amazon Link
Software Development for Small Teams : Google Books
Google Book Link
Reference Links 4
90. What Is Domain-Driven Design? : O'Reilly
https://www.oreilly.com/library/view/what-is-domain-driven/9781492057802/ch04.html
Steve Jobs, 1955-2011 :
https://www.theverge.com/2011/10/05/steve-jobs-1955-2011-2
Wasmtime:A small and efficient runtime for WebAssembly & WASI
https://wasmtime.dev/
Fastly のネイティブ WebAssembly コンパイラ & ランタイム「Lucet」を発表
https://www.fastly.com/blog/announcing-lucet-fastly-native-webassembly-compiler-runtime
WebAssembly Micro Runtime(WAMR):組み込み向け軽量ランタイム(JIT除く)
https://github.com/bytecodealliance/wasm-micro-runtime
WASMER
https://wasmer.io/
WebAssembly System Interface (WASI): Node.js v17.1.0 documentation
https://nodejs.org/api/wasi.html
Azure Active Directory Domain Services のマネージド ドメインのグループ ポリシーを管理する
https://docs.microsoft.com/ja-jp/azure/active-directory-domain-services/manage-group-policy
移動ユーザー プロファイルの展開
https://docs.microsoft.com/ja-jp/windows-server/storage/folder-redirection/deploy-roaming-user-profiles#step-4-
optionally-create-a-gpo-for-roaming-user-profiles
UBUNTU 12.04 ACTIVE DIRECTORY AUTHENTICATION
http://koo.fi/blog/2013/01/06/ubuntu-12-04-active-directory-authentication/
Reference Links 5
91. Ubuntu Linux 仮想マシンを Azure Active Directory Domain Services のマネージド ドメインに参加させる
https://docs.microsoft.com/ja-jp/azure/active-directory-domain-services/join-ubuntu-linux-vm
Android で MSAL を使用してクロス アプリ SSO を有効にする : Microsoft Docs
https://docs.microsoft.com/ja-jp/azure/active-directory/develop/msal-android-single-sign-on
Containers in the enterprise:Results from research conducted in 2020 by IBM Market Development & Insights
https://www.ibm.com/downloads/cas/VG8KRPRM
Reference Links 6
Editor's Notes
前回に引き続き、コンテナライズの設計についてお話します。ドメインドリブンデザインについては前回お話したので、今回はコンテナライゼーションの実装例として、RustでWebサービスするRust WebAssembly、Node + Expressでサービスする非同期Web APIで生産性を高めるエコシステムの構成例をご紹介します。Azure Static Web AppsでサービスするBlazor WebAssemblyについては2月3日のMicrosoft Developer Dayでお話していますので、本日は軽く触れます。【クリック】井上章さんのキーノートもありますのでぜひ登録ください。またWebAssembly System Interfaceについても実装例ではなく仕組みのお話をします。いずれのアーキテクチャもコンテナライゼーションによるバーチャライゼーション・テクノロジーの効果に言及します。
GitHubは組織でチーム開発ができます。そのためGitHubの組織アカウントをお持ちの方もAzure Active Directoryの方も開発に参加できます。コミット等の操作はCLIで行いますのでGitHub CLIをインストールします。dockerと同じようにキーを取得後ダウンロードしてインストールします。ただし、今度はdocker内のAlpine Linuxで行いますのでsudoは使いません。
作業効率の良い環境で作業してください。私はWindowsのVisual Studio Codeでの作業に慣れているのでGitHubからダウンロードして作業をしています。Windows側では、まずnodeのバージョンを確認して必要に応じてインストールしてください。【クリック】…【クリック】linux側と同じなら問題ありません。また、node_modulesフォルダ、.gitignoreファイルやhttp-errorのnodeモジュール、expressのbody-parserや開発証明書も追加します。【クリック】.gitignoreファイルはdotnet newで作ります。【クリック】実際この6行打つだけで画面が出ます。
今度はWindows側で開発するのでVisual Studio CodeのExtensionを追加しておきます【画面説明】
GitHubからダウンロードしてきたフォルダをVisual Studio Codeで開いてデバッグペインを開くとデバッグ方法の選択肢が表示されます。【クリック】Run and Debugで選択ツールバーが表示しますので、EdgeかChromeを選択します。【クリック】launch.jsonが開くのでurlのポートを80に直してAdd configurationを選びます。【クリック】選択肢が表示されますので、リストの一番下まで移動し「Run “npm start” in a debug terminal」を選択します。【クリック】最後に出来上がった2つをcompaundsでつなげてデバッグリストの名前を選択して実行します。【クリック】terminalで200、スタックにブラウザとnpmが起動していることを確認します。終了はデバッグのツールバーで2つのスタックを終了させます。
SVGを取得する部分を作成します。【クリック】外部APIリクエストにaxiosとSVGのXML部分を抜き出すのにexpress-xml-bodyparserを使うのでVisual Studio Codeのターミナルを使ってインストールします。また、今回は使いませんが「npm i svgson」でインストールしておくとオブジェクトとしてSVGを扱えるのでSVGアイコンの色付けなどが簡単に行えるようになります。【クリック】外部Webサイトにリクエストを投げる部分とレスポンスを取得する部分は、10個と1個の違いなのでほぼ同じですが、axiosの使い方に少し工夫します。【クリック】svgを受け取る際に同期処理としてresponse.dataを待ちます。また、Expressサーバーが次の処理に進むのはファンクションの中で10個取得したかどうかを判定しています。【クリック】実行するとThunder Clientで、ひとつ取得と10個取得ができていることを確認できます。さきほどsvgsonを今回やらないと言いましたがこのSVGのXMLはサニタイズされているので後処理が必要です。その後処理を行うためにsvgsonを使うので後述します。これをGutHubにコミットしてコンテナ側と同期することができます。
次にmongoです。【クリック】Dockerの8082のデータベースを起動しておいてVisual Studio CodeでMongoDB Extentionを起動します。先ほど作成したコネクションを選択して、Add Databeseを選択します。Playgroundが開きますので、編集してDBを作成して行きます。【クリック】database「SVGServiceDB」、collection「UsersState」、createCollectionはそのままで「db.UsersState.Insert」を追加します。フィールドはaccountとurlだけ入れておきます。値は好きなものを入れておきます。先ほど設計した内容では、既定で「アイコンを取ってきてからDBに書き込み」です、また最新を問い合わせるオプションはまだ実装していないので、この状態でプログラムの開発準備が整いました。実行します。【クリック】Resultが表示されますので、Playgroundの3点リーダーを使って画面を操作します。【クリック】追加されたことを確認します。
npm I mongodbでインストールした後にrequireでインポートしてコードで使用します。【クリック】処理ではmongoClientの接続、アカウントの有無確認アップデートまたは追加の処理を追加するだけです。
手順はMongoDBの時と同じです。Neo4jのオフィシャルイメージをDockerからpullしてrustをインストール、rustの簡単なプロジェクトを作成してVisual Studio Codeで作成していきます。RustアプリケーションではTerminusDBを使った方が楽かもしれませんが、今回はlinux/arm64/v8のオフィシャルイメージがあるNeo4jを使っています。Neo4jはDBにアクセスするWebコンソールも付いていますので特に難しい手順はありません。【クリック】【Neo4j + Rust手順】【クリック】【Hello world手順】【クリック】プログラムが動くことが確認できたので、残りはWindowsの方のVisual Studio Codeで作成します。Neoの動作も確認します【クリック】コンテナは動いてますのでブラウザで確認するだけです【クリック】ポート7474がWebコンソール、7687がDBのAPIです。認証無しで接続します。【クリック】接続が完了したらお気に入りのHello Worldをクリックします。【クリック】
いくつかのライブラリをエコシステムから利用できます。【クリック】次にリリース時にローカルの7878ポートをListenしてリクエストストリームを処理するWebサーバーを作ります。【クリック】処理の中身はストリームの読み書きです。【クリック】読み込んでリクエスト別に処理を分けるのですが、今回はそのままストリームに書き込みを行います。書き込む内容は与えられた文字からQRコードSVGを作成し、SVGのXMLを書き込みます。【クリック】ターミナルで「cargo run --release」をタイプし、ブラウザで7878ポートを参照するとバーコードが表示されます。【クリック】ブラウザのデバッグツールではレスポンスヘッダやステータスコードが設定どおりに送信されていることを確認できます。
次は「--release」でブラウザに表示させたいのでWebAssemblyを表示できるようにします。
WindowsのRustアプリはWindws OSで管理されていましたが、Dockerの中のRustアプリはAlpine Linuxで管理されています。そのため、ちょっとした変更が必要になります。
まず、Dockerのコンテナは「--network host」をつけて起動します。次に中に入ったら「rustup」を設定します。これはWindows側でVisual Studio CodeがやっていたことをLinux側であるためにLinkerの働きをするtoolchainという機能の設定になります。また、Dockerはコンテナでハードウェアを仮想化しているのでコンパイル・ターゲットはARM64用のLinuxのGNU C Libraryを使うようにしています(https://doc.rust-lang.org/rustc/platform-support.html)。【クリック】開発環境に合わせてください。【クリック】
設定ができたらビルドして実行します。実行時にターゲットを指定するか、コンテナの既定ターゲットを設定してビルドするかは運用設計によって異なります。PoCなどのようにデプロイ先の環境を決めないで可搬性を優先させるとか、プロダクション環境のスケールベースなどのように開発者のミスを軽減したいとか、運用設計によって変更してください。「--release」で実行するとホスト側のWindowsでブラウザやVisual Studio Codeからアクセスできます。【クリック】