Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

marine simpleName 対応 #56

Merged
merged 5 commits into from
Apr 8, 2024
Merged

marine simpleName 対応 #56

merged 5 commits into from
Apr 8, 2024

Conversation

Syogo-Suganoya
Copy link
Contributor

@Syogo-Suganoya Syogo-Suganoya commented Sep 30, 2023

  • image リストの修正(env.yml)
  • バージョンが最新に保たれる(チャレンジを更新しなくても勝手に変わる)旨の追記
  • C#に関して注意事項の追記
  • チャレンジやブックの imageName の修正
  • チャレンジやブックの C#のcsprojの修正

@Syogo-Suganoya Syogo-Suganoya self-assigned this Sep 30, 2023
@Syogo-Suganoya Syogo-Suganoya linked an issue Sep 30, 2023 that may be closed by this pull request
@Syogo-Suganoya
Copy link
Contributor Author

以下はmappings.ymlとマッチしているものが見当たらなかったため、そのままとしています。

imageName: givery/track-base2

imageName: givery/track-cpp-googletest

imageName: givery/track-base2

Copy link
Contributor Author

@Syogo-Suganoya Syogo-Suganoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snakazawa review me

Comment on lines -24 to +27
- imageName: givery/track-nodejs-8
- imageName: nodejs

### hint
JavaScript(Node.js)を使用するセクションを作成する際にはDockerイメージとして`givery/track-nodejs-8`を使用します。
JavaScript(Node.js)を使用するセクションを作成する際にはDockerイメージとして`nodejs`を使用します。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

チャレンジやブックの imageName の修正

[build.gradle](build.grade)はテストの実行結果を[TAP](https://testanything.org/)形式で出力するようにカスタマイズされています。
[build.gradle](build.gradle)はテストの実行結果を[TAP](https://testanything.org/)形式で出力するようにカスタマイズされています。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

testCompile 'junit:junit:4.12'
implementation group: 'junit', name: 'junit', version: '4.13.2'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gradleの compile の書き方が変更されたので、併せて修正しました。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javaのチャレンジってmavenじゃなくてgradleで作るように案内してるんでしたっけ?
gradleの方がversionセンシティブな気がするので、注意が必要です。

この設定がMarine(=OrcaImages 2.1.1)で動くことは多分確認していると思うんですが、現時点でのprodイメージであるOrcaImages2.0.2でも動くかを確認してください。(imageName: givery/track-cli-java:2.0.2としてMarineで動作するかも確認してください。)

また、バージョン番号が明記されている点も気になります。
maven, gradle, junitなどはOrcaImagesにpre-installされています。

なので、installされているバージョンが使用される場合はbuildも高速に動作するんですが、異なるバージョンが使用される場合初回実行でdownloadが走るので、パフォーマンス的に不利になります。(2回目以降の実行ではキャッシュが使えるので実行速度上の不利はありませんが、ブラウザでリロードするとまたdownloadからになります。)

この辺環境変数を活用する方法もあるようなので、

https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties

次にOrcaImagesを作るときはこの辺の環境変数も合わせて設定した方が良いかもしれません。

imageName: givery/track-java-8
imageName: java
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contents/sample/coding-java/ はコンテンツ作成マニュアルに使用するサンプルですが、notionの方も併せて修正しました。
https://www.notion.so/givery/c71f8d3ba35a45a08c25c73666ed4fc1

また、マニュアルに使用予定の未マージの下記プルリクのイメージも併せて修正しました。

Comment on lines +4 to +9
<DOTNET_FRAMEWORK_VERSION Condition=" '$(DOTNET_FRAMEWORK_VERSION)' == '' ">net6.0</DOTNET_FRAMEWORK_VERSION>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>$(DOTNET_FRAMEWORK_VERSION)</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

チャレンジやブックの C#のcsprojの修正

- givery/track-rust-1.39
- givery/track-haskell-14.11
- givery/track-python3.7-anaconda
- cpp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image リストの修正(env.yml)

docs/ja/env.md Outdated
Comment on lines 55 to 57
これらのイメージは[DockerHub](https://hub.docker.com/u/givery)で公開されているイメージと次のようにマッピングされています。`cacheDirs`などを含んだマッピングではデフォルトでその設定が反映されます。例えば`java`イメージを使用する時、envConfに`cacheDirs`を記載しなくても、自動で`cacheDirs`に`/root/.m2`の設定が反映されます。

<details><summary>イメージのマッピング(クリックして展開)</summary>
Copy link
Contributor Author

@Syogo-Suganoya Syogo-Suganoya Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image リストの修正(env.yml)

image リストの後ろに下記も追記しておきました。

  • DockerHub 参照時のイメージ名
  • cacheDirsの自動反映の説明

Comment on lines +128 to +129
### イメージのバージョンについて
イメージは自動で最新に保たれます。envConfを逐一更新する必要はありません。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

バージョンが最新に保たれる(チャレンジを更新しなくても勝手に変わる)旨の追記

Comment on lines +142 to +143
C#に使用するcsprojファイルの`PropertyGroup`には以下の設定を記載してください。バージョンが変わっても動作するようにするためです。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C#に関して注意事項の追記

Comment on lines +131 to +132
#### バージョンの依存について
バージョンに依存するライブラリを利用している場合はご相談ください。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet のバージョンに依存するライブラリを利用している場合はこれだけだと動かなくなる可能性があるためご相談ください。

バージョンの依存についても追記しました。

https://givery.slack.com/archives/C39R16W7J/p1695969539480769?thread_ts=1695966255.249269&cid=C39R16W7J

Copy link
Contributor

@snakazawa snakazawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- perl
- php
- python
- python3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pythonとpython3はどちらも同じイメージ(python3)が使われます。
(SimpleNameではpython2はサポートされません)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下の書き方に修正しました。

- python
  - `python3`でも可能です。どちらも同じ `givery/track-cli-python3` のイメージが使用されます。

docs/ja/env.md Outdated
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageName: postgresとした場合はusernameとbaseDirの指定は必要なくなりました。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「postgresの注意事項」のセクションを削除しました。

testCompile 'junit:junit:4.12'
implementation group: 'junit', name: 'junit', version: '4.13.2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javaのチャレンジってmavenじゃなくてgradleで作るように案内してるんでしたっけ?
gradleの方がversionセンシティブな気がするので、注意が必要です。

この設定がMarine(=OrcaImages 2.1.1)で動くことは多分確認していると思うんですが、現時点でのprodイメージであるOrcaImages2.0.2でも動くかを確認してください。(imageName: givery/track-cli-java:2.0.2としてMarineで動作するかも確認してください。)

また、バージョン番号が明記されている点も気になります。
maven, gradle, junitなどはOrcaImagesにpre-installされています。

なので、installされているバージョンが使用される場合はbuildも高速に動作するんですが、異なるバージョンが使用される場合初回実行でdownloadが走るので、パフォーマンス的に不利になります。(2回目以降の実行ではキャッシュが使えるので実行速度上の不利はありませんが、ブラウザでリロードするとまたdownloadからになります。)

この辺環境変数を活用する方法もあるようなので、

https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties

次にOrcaImagesを作るときはこの辺の環境変数も合わせて設定した方が良いかもしれません。

Copy link
Contributor Author

@Syogo-Suganoya Syogo-Suganoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shunjikonishi review me

javaのチャレンジってmavenじゃなくてgradleで作るように案内してるんでしたっけ?

metatestを使わずに済むという点からgradleを採用しました。詳しくはこちら↓を参照ください。
#49

OrcaImages2.0.2でも動くかを確認してください。

正常に動作することを確認しました。

この辺環境変数を活用する方法もあるようなので、

すみません環境変数などは疎いので、一旦保留としました。

- perl
- php
- python
- python3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下の書き方に修正しました。

- python
  - `python3`でも可能です。どちらも同じ `givery/track-cli-python3` のイメージが使用されます。

docs/ja/env.md Outdated
```
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「postgresの注意事項」のセクションを削除しました。

implementation group: 'junit', name: 'junit', version: '4.13.2'
implementation group: 'junit', name: 'junit', version: '4.+'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

バージョン番号が明記されている点も気になります。

バージョンはJunit4のみを指定して、それ以下はワイルドにしました。

Copy link
Contributor

@shunjikonishi shunjikonishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mappings.ymlの内容をまるごと転記しているのが少し気になりましたが、一旦このままでOKです。

最終的には社外のコンテンツ開発者が指定するのはimageNameだけにしたいと思っており、今のsimpleNameでほぼ実現できているとも思っています。

なので、cacheDirsとかworkingDirみたいな内容が説明なしででてくるのは微妙かなと思ったり、mappings.ymlが変わった時に追随するの面倒じゃないかな、と思ったりもするんですが秘密情報ではないし、テスト実行の仕組みを深く知る上では有益な情報でもあるのでとりあえずはこれでOKとします。

@shunjikonishi shunjikonishi merged commit 52d87c5 into master Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

marine simpleName 対応
3 participants