前回はBluemix上の.NET Coreを更新するべく作業しました(途中)。

Bluemix CLI

前回は、Bluemix CLIのインストーラを入手しました。
これをインストールします。

インストール先の指定すらない….

はいはい、再起動再起動

buildpack更新

注:この先の処理を実施するとBluemixのアプリの環境が壊れます。

ダッシュボードのCF CLIの説明から、Bluemixへの接続がわかりましたので、CF CLIによるbuildpackの更新は下記の流れになります。
管理者権限でコマンドプロンプトを立ち上げ、gitでクローンしたアプリのディレクトリに移動します。
次に下記のコマンドをメモ帳にでも張り付けて、コマンドプロンプトに張り付けます。
(当然文字列は各自環境に応じて置換すること)

1
2
3
4
bluemix api https://api.au-syd.bluemix.net
bluemix login -u <Bluemix ユーザーID> -o <組織の名前> -s <スペースの名前>
<Bluemixのパスワード>
cf push <アプリの名前> -b https://github.com/cloudfoundry-community/dotnet-core-buildpack.git

これにより、対話をすることなくbuildpackの更新が始まります。

が、失敗します。
正確には、buildpackの更新はうまくいっている感じです。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
D:\Works\OpenSource\IBM Bluemix\TRY-BLUEMIX-TEST1>bluemix api https://api.au-syd.bluemix.net
'cf api https://api.au-syd.bluemix.net' を起動しています...

Setting api endpoint to https://api.au-syd.bluemix.net...
OK

API endpoint: https://api.au-syd.bluemix.net (API version: 2.54.0)
User: hogehoge@hoge.com
Org: TRY-BLUEMIX
Space: SPACE1

D:\Works\OpenSource\IBM Bluemix\TRY-BLUEMIX-TEST1>bluemix login -u hogehoge@hoge.com -o TRY-BLUEMIX -s SPACE1
'cf login -u hogehoge@hoge.com -o TRY-BLUEMIX -s SPACE1' を起動しています...

API endpoint: https://api.au-syd.bluemix.net

Password>
Authenticating...
OK

Targeted org TRY-BLUEMIX

Targeted space SPACE1

API endpoint: https://api.au-syd.bluemix.net (API version: 2.54.0)
User: hogehoge@hoge.com
Org: TRY-BLUEMIX
Space: SPACE1

D:\Works\OpenSource\IBM Bluemix\TRY-BLUEMIX-TEST1>cf push TRY-BLUEMIX-TEST1 -b https://github.com/cloudfoundry-community/dotnet-core-buildpack.git
Using manifest file D:\Works\OpenSource\IBM Bluemix\TRY-BLUEMIX-TEST1\manifest.yml

Updating app TRY-BLUEMIX-TEST1 in org TRY-BLUEMIX / space SPACE1 as hogehoge@hoge.com...
OK

Using route try-bluemix-test1.au-syd.mybluemix.net
Uploading TRY-BLUEMIX-TEST1...
Uploading app files from: D:\Works\OpenSource\IBM Bluemix\TRY-BLUEMIX-TEST1
Uploading 33K, 17 files
Done uploading
OK

Stopping app TRY-BLUEMIX-TEST1 in org TRY-BLUEMIX / space SPACE1 as hogehoge@hoge.com...
OK

Starting app TRY-BLUEMIX-TEST1 in org TRY-BLUEMIX / space SPACE1 as hogehoge@hoge.com...
-----> Downloaded app package (24K)
-----> Downloaded app buildpack cache (138M)

Cloning into '/tmp/buildpacks/dotnet-core-buildpack'...

Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out '211c02226a2612c8a3b724ebb0983c88b8c95e75'
ASP.NET Core buildpack version: 0.9.0
ASP.NET Core buildpack starting compile
-----> Restoring files from buildpack cache
Copied 37 files from /tmp/cache/libunwind to /tmp/staged/app
Copied 199 files from /tmp/cache/.dotnet to /tmp/staged/app
Copied 8120 files from /tmp/cache/.nuget to /tmp/staged/app
OK
-----> Extracting libunwind
libunwind version: 1.1
https://github.com/cloudfoundry-community/dotnet-core-buildpack/releases/download/v0.7/libunwind-cflinuxfs2-1.1.tar.gz
OK
-----> Installing Dotnet CLI
dotnet version: 1.0.0-preview2-003121
https://go.microsoft.com/fwlink/?LinkID=809129
OK
-----> Restoring dependencies with Dotnet CLI
Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
Configuring...
-------------------
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 3819 ms
Expanding 100% 6266 ms
log : Restoring packages for /tmp/staged/app/src/dotnetstarter/project.json...
log : Writing lock file to disk. Path: /tmp/staged/app/src/dotnetstarter/project.lock.json
log : src/dotnetstarter/project.json
log : Restore completed in 2969ms.
OK
-----> Saving to buildpack cache
Copied 1 files from /tmp/staged/app/libunwind to /tmp/cache
Copied 203 files from /tmp/staged/app/.dotnet to /tmp/cache
Copied 7552 files from /tmp/staged/app/.nuget to /tmp/cache
OK
ASP.NET Core buildpack is done creating the droplet
-----> Uploading droplet (292M)

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
Could not fetch instance count: Server error, status code: 400, error code: 170002, message: App has not finished staging
Could not fetch instance count: Server error, status code: 400, error code: 170002, message: App has not finished staging
Could not fetch instance count: Server error, status code: 400, error code: 170002, message: App has not finished staging
Could not fetch instance count: Server error, status code: 400, error code: 170002, message: App has not finished staging
Could not fetch instance count: Server error, status code: 400, error code: 170002, message: App has not finished staging

Installing Dotnet CLI dotnet version: 1.0.0-preview2-003121とあり、OKと言っているので、更新は成功したのでしょう。
でも、その後アプリを再起動しても起動に失敗しています。

ダッシュボードを見ると、

一瞬Sad Macに見えた

となって、ASP.NET Coreの名前が消えてしまいました。

どうも環境を壊してしまった模様。

とりあえず、bluemixの環境を変えるのではなく、ローカルを合わせるという方針で開発をしていこうと思います。
(そもそもWindows 7上で開発する意味もあまりない気がしますが….)

Conclusion

非常に残念な結果になりました。