Sakura: Azure Pipelines を調査する

Created on 16 Sep 2018  ·  59Comments  ·  Source: sakura-editor/sakura

Azure Pipelines を調査する

https://azure.microsoft.com/ja-jp/services/devops/pipelines/

オープン ソース用に 10 個の無料の並列ジョブ (時間制限なし) を実行可能な、Linux、macOS、
および Windows 用のクラウドホステッド パイプラインを入手

とある。

調べること

CI azure pipelines research

Most helpful comment

Hello. I'm a product manager for Azure Pipelines. If there's anything I can do to help, let me know. (I'm sorry for chiming in using English. I don't know Japanese.)

All 59 comments

オンラインでコンパイルできるってことですよねぇ。
コンパイラ(例えばDelphi)とか持ち込めるのかなぁ。。。

ちなみに 2018年9月13日に発表されたばかりみたいです。
https://www.publickey1.jp/blog/18/cicdazure_pipeline130.html

2018年9月10日に発表されたみたいです。
https://azure.microsoft.com/en-us/blog/announcing-azure-pipelines-with-unlimited-ci-cd-minutes-for-open-source/

10 個の無料の並列ジョブ が魅力ですね。

appveyor に Azure Pipelines と同程度あるいはそれ以上の同時タスクをサポートしてほしいと送ってみた。
https://github.com/appveyor/ci/issues/2641

オンラインでコンパイルできるってことですよねぇ。

Windows に対応している Cloud の CI として appveyor を使っていましたが、
採用当時、windows に対応しているが、appveyor しか選択肢がありませんでしたが、
他に候補ができたということです。

説明欄に調査項目を追加しました。

https://github.com/MicrosoftDocs?utf8=%E2%9C%93&q=pipelines&type=&language=
で検索すると pipeline の YAML の書き方のサンプルプロジェクトを検索できる。

以下は ASP.NET Core project using Azure Pipelines のサンプル
https://github.com/MicrosoftDocs/pipelines-dotnet-core/blob/master/azure-pipelines.yml

c++ は見当たらないけどサポートしてないのかな?

以下関連ドキュメント
https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-yaml?view=vsts
https://docs.microsoft.com/en-us/azure/devops/pipelines/build/ci-public?view=vsts&tabs=github

sakura editor には関係ないけど iOS のビルドもできそう。
https://github.com/MicrosoftDocs/pipelines-xcode

c++ は見当たらないけどサポートしてないのかな?

https://docs.microsoft.com/en-us/azure/devops/pipelines/apps/windows/cpp?view=vsts
に cpp に関する記述がある

https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-designer?view=vsts&tabs=new-nav
にリンクが張ってあって Web から設定する説明がある。

appveyor は使うの簡単だったけど、 Azure Pipelines は使うの難しそう。

https://docs.microsoft.com/en-us/azure/devops/pipelines/index?view=vsts
にドキュメントのトップページがある。

各ページの下に Feedback という項目があり、直接 GitHub 経由で Feedback を送ることが
できるみたい。

成果物の保存期間の調査

https://docs.microsoft.com/en-us/azure/devops/pipelines/policies/retention?view=vsts
に記載があって、どれぐらいの期間保存するのかを確認方法が説明されているが、
具体的にどれぐらいかは記載されていない。

Hello. I'm a product manager for Azure Pipelines. If there's anything I can do to help, let me know. (I'm sorry for chiming in using English. I don't know Japanese.)

@vtbassmatt Thank you for your comment.
Currently we use AppVeyor in this project, and now we are investigating if we can use Azure Pipelines instead (or parallelly). We think that 10 parallel jobs for OSS projects is attractive, but using Azure Pipelines looks more difficult than AppVeyor.

I would be grateful to know which part is more difficult. We can make product changes or documentation improvements.

Azure Pipelines has a LOT of options and flexibility, which makes it challenging/overwhelming to get started with. Did you see our templates repository? That might be a good place to start - we have templates for most languages and platforms.

@vtbassmatt

Azure Pipelines has a LOT of options and flexibility, which makes it challenging/overwhelming to get started with. Did you see our templates repository? That might be a good place to start - we have templates for most languages and platforms.

I don't see a template for Windows classic desktop application which would be of use to us.

@vtbassmatt

We have the following issues to solve.

  • We need to run Set-WinSystemLocale ja-JP and Restart-Computer with Powershell to change system locale before starting builds.
  • We need to specifiy build settings by a configuration file like appveyor.yml so that anyone can request to change build settings and review them.
  • We need the following tools on build environments.

    • Visual Studio 2017 Community

    • Inno Setup Unicode (innosetup-5.5.9-unicode.exe or innosetup-5.6.1-unicode.exe)

    • HTML Help Compiler

    • Python 2.7.x (including pip)

    • 7Zip

    • (if possible) MingW

  • We use custom batch files to build all artifacts.
  • We need an organization acoount for CI so that project members can control it.
  • Anonymous users can download any aritifacts including for master, branches, and PR from CI.

Do you have any user support repository for Azure Pipeline on GitHub like https://github.com/appveyor/ci ?

appveyor's document is very easy to understand.
It explains what tools are installed on the build images, what environment variables are available,
and how we write appveyor.yml.

@vtbassmatt

I'd like to see pipelines-cplusplus sample app repository which isn't available yet.

I see 10 repositories on this query result page.
https://github.com/MicrosoftDocs/?utf8=%E2%9C%93&q=pipeline&type=&language=

But I see only 5 programming languages listed on the documentation.
https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-yaml?view=vsts#get-the-sample-code
The other 5 missing repositories must be weeping...

@vtbassmatt

Can you please provide a link to https://azure.microsoft.com/en-us/services/devops/pipelines/ on this page?
I had to manually type the address which was quite challenging for me. The screenshots seem really helpful but due to the lack of the link, an average person might not start the procedure.

@vtbassmatt

I didn't know the template named .NET Desktop can also be used for Windows classic desktop solutions.
Disguised name!

image

Thanks for all the feedback!

  • I have submitted the PR to add a link to the signup page. Really silly oversight on our part.
  • Feedback noted about building Windows desktop apps. I'll see what we can do.
  • Good idea about having a C++ sample app!
  • We're YAML based like AppVeyor, and you can easily run batch scripts as part of the build.
  • I need to check our set of pre-installed tools; for any that we're missing, we can get those into the image. VS2017 and Python 2.7 with pip are definitely available.
  • You can add whoever you want to your Azure Pipelines organization.
  • We currently have a bug with uploading artifacts from a PR fork build. However, uploading from any non-fork build works, and anyone on the internet can access those artifacts.

Unfortunately, the one thing I haven't found a workaround for is changing the system locale. I don't believe you can reboot our hosted agents. We support private agents (which you can configure with any software or settings you want), but then you lose the value of having everything cloud-hosted.

I'm still looking into this, though, and maybe someone on my team will have a suggestion.

Oh - I missed two things.

@vtbassmatt

When I tried Azure Pipelines, I was asked to log in by Microsoft Account.

If it is possible to log in by GitHub Account like appveyor, let me how.
If not, please support it (including GitHub organization account).

I think most of GitHub users want to log in by GitHub accounts instead of Microsoft Accounts.

For now you have to use a Microsoft Account. We want to support GitHub identities but don't have a timeframe yet.

@vtbassmatt I'm wondering if importers and migration guides from AppVeyor or Travis or Jenkins are available to us.

@beru we're writing some of that up. The person responsible for it is at a conference all week but I think he plans to get started next week.

Unfortunately we don't have a good workaround for needing to reboot the agents. It's been added to our backlog. If you're interested in still trying Azure Pipelines, you could set up self-hosted Windows agents that are already configured in ja-JP, so no reboot would be required.

@vtbassmatt

Unfortunately we don't have a good workaround for needing to reboot the agents.

@berryzplus removed the necessity of rebooting agents at #482 by setting /execution-charset:shift_jis.
So we don't need a workaround any more.

Oh, great! When I get a few minutes, I'll see if I can port over your Appveyor config.

I took a run at this, but I don't know enough about building C++ apps or this code in particular to be successful. There are lots of hardcoded references to AppVeyor which I couldn't easily extract.

I'm still happy to help by answering questions and getting you information, though!

@vtbassmatt

There are lots of hardcoded references to AppVeyor which I couldn't easily extract.

We use some appveyor environment variables in https://www.appveyor.com/docs/environment-variables/

  • APPVEYOR_ACCOUNT_NAME
  • APPVEYOR_BUILD_NUMBER
  • APPVEYOR_REPO_COMMIT
  • APPVEYOR_REPO_TAG_NAME
  • APPVEYOR_URL
  • APPVEYOR_BUILD_VERSION
  • APPVEYOR_PROJECT_SLUG
  • APPVEYOR_PULL_REQUEST_NUMBER
  • APPVEYOR_PULL_REQUEST_HEAD_COMMIT
  • APPVEYOR_REPO_NAME
  • APPVEYOR_REPO_PROVIDER

Do you have alternative variables on Azure Pipelines?

Note: we support building this software locally. So you can build it without these appveyor-specific variables for an experiment.

GitHub 連携始めたみたい。(It seems that the integration between GitHub and Azure Pipelines has alredy started)
https://github.com/marketplace/azure-pipelines
https://blog.github.com/2018-09-10-azure-pipelines-now-available-in-github-marketplace/

@vtbassmatt

For now you have to use a Microsoft Account. We want to support GitHub identities but don't have a timeframe yet.

Do you have the timeframe now?

Nothing to announce right now.

さっき Microsoft Azure のアカウント登録してきました。
https://azure.microsoft.com/ja-jp/features/azure-portal/
個人だとSMS認証とクレジットカードの登録がいるんですね。
他で使うアテがない場合、アカウント登録の敷居は高いように思いました。

GitHubアカウントを連携して使えるように・・・というか、
organizationで共用できるようになるまでは少しかかりそうかな?と思っています。

そろそろ少しずつ試験運用をしてみてもいいかな~と思い始めました。
個人アカウントを用意できる人で「色々やってみる」を試験運用と言ってます。
結果は できるだけここに書く というスタンスでまずはやってみようってことです。

@vtbassmatt

Nothing to announce right now.

thank you for your reply.
we want to use the Azule-pipeline as a user-group named SAKURA editor organization on GitHub.
we would like to start trial anyway, to learn about that on a personal basis.

Azure Pipelinesを個人的なプロジェクトで試して見ましたが、案外簡単そうです。azure-pipelines.ymlというファイルを適当な場所に置いて、環境設定やステップを順に並べてけばOKでした。

  1. Batch Script taskをいくつか並べる
  2. CopyFilesでArtifactsフォルダにコピー
  3. PublishBuildArtifactsでZIP作成

みたいに並べれば良さそう。GitHub Releaseタスクとか、Extract Filesタスク、サードパーティマーケットからChocolateyタスクなどもあるので、必要に応じて使えそうです。

↓個人的なプロジェクトのビルドの一部。build.shでsrc→distにビルドしてます。

trigger:
  - master
pool:
  vmImage: 'ubuntu-16.04'
steps:
- task: ShellScript@2
  inputs:
    scriptPath: build.sh
- task: CopyFiles@2
  inputs:
    contents: |
      dist/**
      src/**
    targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: $(Build.ArtifactStagingDirectory)
    artifactName: MyBuildOutputs

Predefined build variables

* AppVeyorと同質の情報は得られそう

* https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts

| appveyor | azure pipelines | comment|
----|----|----
|APPVEYOR_ACCOUNT_NAME | ? |
|APPVEYOR_BUILD_NUMBER | BUILD_BUILDID | |
|APPVEYOR_REPO_COMMIT | BUILD_SOURCEVERSION | can be obtained by git show -s --format=%H |
|APPVEYOR_REPO_TAG_NAME | ? | |
|APPVEYOR_URL | SYSTEM_TASKDEFINITIONSURI | |
|APPVEYOR_BUILD_VERSION | BUILD_BUILDNUMBER | https://docs.microsoft.com/ja-jp/azure/devops/pipelines/build/options?view=azure-devops&tabs=yaml |
|APPVEYOR_PROJECT_SLUG | SYSTEM_TEAMPROJECT | |
|APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH | SYSTEM_PULLREQUEST_SOURCEBRANCH | |
|APPVEYOR_PULL_REQUEST_NUMBER | SYSTEM_PULLREQUEST_PULLREQUESTNUMBER | |
|APPVEYOR_PULL_REQUEST_HEAD_COMMIT | SYSTEM_PULLREQUEST_SOURCECOMMITID | |
|APPVEYOR_REPO_NAME | BUILD_REPOSITORY_NAME | |
|APPVEYOR_REPO_PROVIDER | BUILD_REPOSITORY_PROVIDER | |
| N/A | BUILD_REPOSITORY_URI | repository URL |

https://www.appveyor.com/docs/environment-variables/
https://docs.microsoft.com/ja-jp/azure/devops/pipelines/build/variables?tabs=yaml&view=azure-devops#predefined-variables

fixed BUILD_SOURCEVERSION and SYSTEM_PULLREQUEST_SOURCECOMMITID in the above table.

@vtbassmatt

I enteroounterd the limition of free users.
Is there any way to remove the restriction for open source organization?

https://docs.microsoft.com/ja-jp/azure/devops/organizations/billing/buy-basic-access-add-users?view=azure-devops&viewFallbackFrom=vsts

In this quickstart, you learn how to pay for more users in your organization. You only need to pay for users when your team size exceeds the free limits. It's free to add users who have a Visual Studio subscription. You also get five free additional users in your organization.

azure pipelines project for this project is https://dev.azure.com/sakuraeditor/sakura/_build?definitionId=3

For open source, Pipelines-only usage, you don't need to pay for Basic users. You can use Stakeholder users, which are free and have full access to both Pipelines and administrative functions. Sorry for the confusion.

@vtbassmatt

Thank you for the reply and the outstanding CI service for free.

@vtbassmatt

When I tried Azure Pipelines, I was asked to log in by Microsoft Account.

If it is possible to log in by GitHub Account like appveyor, let me how.

I confirmed that log in by GitHub Account is supported now
Thanks, I really appreciate it.

@vtbassmatt

I found the way to rebuild a PR by commenting special messages.
https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers

But it is not easier than Appveyor.
Users can trigger a PR by clicking just "RE-BUILD PR" link on Appveyor.

Is there similar way on Azure Pipelines?

re-build-PR

Once you're using the Azure Pipelines app, there is a "rebuild" button right on the Checks tab. I'm on mobile so I can't share a screenshot easily.

@vtbassmatt

Thank you for the replay.
You mean this?

re-build-PR-azure

That's it!

@vtbassmatt

Unfortunately, the one thing I haven't found a workaround for is changing the system locale. I don't believe you can reboot our hosted agents. We support private agents (which you can configure with any software or settings you want), but then you lose the value of having everything cloud-hosted.

@berryzplus removed the necessity of rebooting agents at #482 by setting /execution-charset:shift_jis.
So we don't need a workaround any more.

We have thought that we don't need to change system locale by using /execution-charset:shift_jis option.
But it is not valid for compiling HTML Help.

Compiling HTML Help on system locale (en-us) has two problems.

  1. The first problem is that it sometimes fails. (#906)
  2. The second problem is that indexes of generated CHM files are garbled. (#922)

Is there any way to compile HTML Help on system locale (en-us) or to change system locate to ja-jp?

I don't think there's an HTML Help compiler that doesn't depend on system locale, and it's not possible to set system locale on the hosted agents.

Maybe something like Locale Emulator could help?

@vtbassmatt

@berryzplus tried it and successfully changed the locale on en-us.
(https://github.com/sakura-editor/sakura/issues/922#issuecomment-497995011) (<- in Japanese comment)
But it is a GUI application, and can't be used on a CI environment as it is.

I don't think there's an HTML Help compiler that doesn't depend on system locale, and it's not possible to set system locale on the hosted agents.

Could you support reboot and change system-locale on Cloud version in the future?
Appveyor has been supporting this.

I think this is the only disadvantage compared to appveyor.

It's on our backlog but no firm commitment about when we'll get there.

@vtbassmatt

I have another question.

Appveyor can notify completion of builds with the following setting.
https://github.com/sakura-editor/sakura/issues/957#issuecomment-508958513

This is a message written by AppVeyorBot.
https://github.com/sakura-editor/sakura/pull/956#issuecomment-508960408

Azure pipelines has notification settings (https://docs.microsoft.com/en-us/azure/devops/notifications/howto-manage-team-notifications?view=azure-devops)

But I didn't find how to do the same as appveyor.

azure-pipelines-bot exists.
So I guess it can possible on Azure Pipelines too.

If so, could you tell me how?

Not possible today. We post Checks to GitHub, and don't have a mechanism to make azure-pipelines-bot post a comment. That's a good idea, though. @davidstaheli for future consideration.

@vtbassmatt, @davidstaheli

Please let us know if it will become available on Azure Pipelines.

@vtbassmatt

Jenkins has a feature to re-use another job's artifacts by using Copy Artifact Plugin.
https://codurance.com/training/2014/10/03/guide-to-deploying-artifacts-with-jenkins/

Is it possible to do the same on Azure Pipelines?

It seems that Copy Files task can copy files within a job.

Caching is coming.

Caching is coming.

To take advantage of Pipeline caching, we need some paradigm shift.
We hope that a build-process will always be built from the latest sources,
and the build-process should always be a 'clean' build.

Was this page helpful?
0 / 5 - 0 ratings