Git Product home page Git Product logo

microsoft / factoryorchestrator Goto Github PK

View Code? Open in Web Editor NEW
39.0 11.0 22.0 5.26 MB

A cross-platform system service which provides a simple way to run and manage factory line validation, developer inner-loop, diagnostics, and fault analysis workflows.

Home Page: https://microsoft.github.io/FactoryOrchestrator/

License: Other

C# 92.36% Batchfile 0.07% PowerShell 4.36% Shell 0.30% HTML 2.91%
manufacturing factory-orchestrator factory testing-framework testing testing-library taef windows windows10x windows-10

factoryorchestrator's Introduction

Build Status

Built to allow device manufacturers and developers to focus more on their validation and calibration software, and less on how to run, audit, and manage the lifecycle of their programs, Factory Orchestrator is a .NET Core cross-platform system service for organizing, executing, and logging a set of executable scripts, binaries, or "Tasks" on a system. Factory Orchestrator tracks task information, including run unique per-run results and logging; even persisting task state to allow the service to be resilient to data loss due to system failure. Factory Orchestrator also provides an optional client app for Windows and a robust client API surface for clients to monitor & interact with the service via the App or C# .NET, C# UWP, or PowerShell code. The app and any other client can communicate with any Factory Orchestrator service running on the same system and/or over a network to a remote device under test (DUT)!

Learn much more about this tool and how to use it by reading the documentation on github.io.

Factory Orchestrator consists of the following projects and binary releases:

  • Microsoft.FactoryOrchestrator.Core A .NET Standard library containing the core FactoryOrchestrator classes. Required in all projects. This is available as "Microsoft.FactoryOrchestrator.Core" on NuGet.

  • Microsoft.FactoryOrchestrator.Client .NET Standard library containing the client-side FactoryOrchestrator classes, required to interact with Microsoft.FactoryOrchestrator.Service. Also contains optional helper classes. This is available as "Microsoft.FactoryOrchestrator.Client" on NuGet.

  • Microsoft.FactoryOrchestrator.UWPClient UWP library containing the client-side FactoryOrchestrator classes, required to interact with Microsoft.FactoryOrchestrator.Service from a Universal Windows Platform app. This is available as "Microsoft.FactoryOrchestrator.UWPClient" on NuGet.

  • Microsoft.FactoryOrchestrator.PowerShell PowerShell module containing a synchronous client-side FactoryOrchestrator class and Cmdlet wrapper classes, designed to be used WITH PowerShell 6+. This is available as "Microsoft.FactoryOrchestrator.Client" on PowerShell Gallery.

  • Microsoft.FactoryOrchestrator.Server A .NET Standard library containing the server-side FactoryOrchestrator classes. Required on all FactoryOrchestrator server projects. "Microsoft.FactoryOrchestrator.Server" on NuGet.

  • Microsoft.FactoryOrchestrator.Service .NET Core Executable project for Microsoft.FactoryOrchestrator.Service.exe, the FactoryOrchestrator server implementation. Requires administrator access to run. This is available on the GitHub Releases page as a .zip.

  • Microsoft.FactoryOrchestrator.App C# UWP app project for Microsoft.FactoryOrchestrator.App.exe, the UWP provides a GUI (Graphical User Interface) to manually interact with Microsoft.FactoryOrchestrator.Service. This is available on the GitHub Releases page as a .msixbundle.

Factory Orchestrator ๐Ÿ’š OSS.

OSS Projects currently forked in source:

  • IpcServiceFramework

    FactoryOrchestrator forks the source of IpcServiceFramework. The fork is equivalent the latest IpcServiceFramework source as of December 2020, with only a project file change to set DisableDynamicCodeGeneration to true so it can be used in .NET Native applications.

  • Pe-Utility

    FactoryOrchestrator minimally forks a portion of the source of Pe-Utility, to build it as a .NET Standard library and reduce the code complexity for FactoryOrchestrator's use case.

Factory Orchestrator src directory structure:

FactoryOrchestrator
โ””โ”€โ”€oss
โ””โ”€โ”€src
    |   App
    |   ClientLibrary
    |   ClientSample
    |   CoreLibrary
    |   PowerShellLibrary
    |   ServerLibrary
    |   Service
    |   Tests
    โ””   UWPClientLibrary

Prerequisites to build source code

Install dependencies

Building Factory Orchestrator source requires the NET 5.0 SDK, the NET Core 3.1 runtime., and PowerShell 7+ (or Windows PowerShell). If you wish to build the app as well, you also need the Universal Windows Platform Development (10.0.19041.0) SDK.

The easiest way to prepare to build the solutions is using any variation of Visual Studio 2019+ (Enterprise, Community). In the installer, make sure you click the checkboxes for .NET Core cross-platform Development, and Universal Windows Platform Development (10.0.19041.0).

You can also use Visual Studio Code, or any whatever editor you prefer. Visual Studio provides a sleek command-line installer that can be used to just deploy the necessary dependencies using their workload component id.

Enable developer mode on Windows

https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development

Other notes

  • There are two Visual Studio .sln files in the src/ folder. Use src/FactoryOrchestratorNoApp.sln if you do not need to build the Windows app or are building on Linux.
  • You may see IntelliSense errors before building Microsoft.FactoryOrchestrator.Core, as that project creates Autogenerated C# files used in other projects.

Debugging

The service will not run properly unless it is run as administrator/sudo. Set "DisableContainerSupport" to "true" on Windows if you see a frequent FactoryOrchestratorContainerException.

If you need to debug the app, run Microsoft.FactoryOrchestrator.App (Universal Windows) and Microsoft.FactoryOrchestrator.Service in separate Visual Studio 2019+ instances. This will allow the app and the service to communicate with each other.

Versioning

Factory Orchestrator uses semantic versioning (semver). All Factory Orchestrator binaries from the same build share the same version; there is no unique client or service version. In the src/common.props file, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards compatible manner.
  • PATCH version when you make backwards compatible bug fixes.

When the MAJOR version diverges between a Client and Service, Clients will be prevented from connecting to the Service by default. Changing the signature of any Microsoft.FactoryOrchestrator.Core class is therefore usually a MAJOR version change and should be done sparingly.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see CODE_OF_CONDUCT.md or contact [email protected] with any additional questions or comments.

Contributing

Accepting the Contributor License Agreement (CLA)

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

Happy Coding!

Reporting Security Issues

Please refer to SECURITY.md.

Open Source Software Acknowledgments

IpcServiceFramework - Jacques Kang - MIT License

Pe-Utility - Andres Traks - MIT License

WindowsDevicePortalWrapper (mgurlitz .NET Standard fork) - Microsoft Corporation and mgurlitz - MIT License

DefaultDocumentation - Paillat Laszlo - MIT No Attribution License

net-mdns/Makaretu.Dns - Richard Schneider - MIT License

factoryorchestrator's People

Contributors

bryanmthomas avatar dependabot[bot] avatar hajya avatar kareszk avatar maxperga-msft avatar neilsandlin avatar nick5616 avatar patelp3989 avatar ritikaguptams avatar romainob avatar spaceisfun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

factoryorchestrator's Issues

Consolidate to one HostBuilder for both IPC & FOService hosting

It's not ideal there are two HostBuilder operations in the service. We should create both FOService & the IPC in the same host, and also allow appsettings.json & command line options to modify the both the Host's service configuration (primarily logging levels) & FOService configuration.

WinUI 3 causes buttons in upper right to move every time network info changes

Describe the bug
With the WinUI 3 build (10.3.1) updates to the network info shown on MainPage causes the buttons in upper right to move on the UI.

To Reproduce
Steps to reproduce the behavior:

  1. Launch UWP 10.3.1
  2. Connect to a device with 2+ network connections
  3. UI in upper right

Repro video
https://user-images.githubusercontent.com/31931010/128423403-af3c8ff7-559b-4d06-a31b-99dd58ea07b5.mp4

Expected behavior
Buttons should never move position.

Environment (please complete the following information):

  • OS: [e.g. Windows 10, Windows Server 2019, Ubuntu 20.04] all
  • Service and/or client version(s) [e.g. 10.0.0] uwp client 10.3.1
  • Any applicable service configuration: N/A

Transfer Files Tab is disabled on localhost app if app starts before container

Describe the bug
Transfer Files Tab is disabled on localhost app even when a container is connected

To Reproduce
Steps to reproduce the behavior:

  1. Boot image with Factory Orchestrator app configured to auto start
  2. If the container starts after the app the Transfer Files tab never appears

Expected behavior
Transfer files tab appears once container is found.

Workaround
If the app is exited and restarted after the container has started, the tab appears.

Environment (please complete the following information):

  • OS: FOS w/ container
  • Service and/or client version(s) 10.3.0

Simplify and streamline build pipelines

What:

  • Use templates where possible
  • Split builds into one Job per Configuration/Architecture
  • Run Policheck and Component Governance on all builds including GitHub (if possible)
  • Add/Improve build pipeline documentation

Why: The current pipelines share no YML code, even though they mostly perform identical tasks. It also needs better documentation for easier debugging & maintenance.

Add support for a "Shutdown/Reboot Task"

WHAT: Add a new Task type for a shutdown/reboot task.

WHY: An automated TaskList might want to reboot the DUT in the middle of the task flow. Currently, you would need to finish a TaskList, reboot via the API, then resume the TaskList.

HOW: Add a new Task type, which is used for Shutdown or Reboot. When executed as part of a TaskList, the reboot operation is performed and then the DUT resumes executing the same TaskList once the DUT has completed the reboot.

TaskRunner.StopTask() doesn't terminate child processes

This is most noticable when running programs via the app command prompt, since they are invoked via cmd.exe /C .

NET Core 3.1 has a Kill(true) method to terminate child processes, but it isn't available in NET Standard, yet. It should be with NET 5.0. Or, copy the implementation of Kill() true and reimplement it in our code

Use $version$ in .AppxManifest files

These files:

  1. Are checked into source
  2. BUT use a version that is dynamically updated based on common.props

They should use an obj file instead like Microsoft.FactoryOrchestrator.Client.psd1

Improve getting started documentation for using the client API

While there is a decent API reference for Factory Orchestrator, and a C# sample showing those APIs in use there is not a good set of building blocks / guides for technical users to ramp up on the programming flows required.

Think: https://docs.microsoft.com/en-us/windows/uwp/get-started/create-a-hello-world-app-xaml-universal, which guides a dev through creating a hello world app, and explains why each step is done. Or https://docs.microsoft.com/en-us/windows/uwp/files/quickstart-reading-and-writing-files which then guides a dev through writing basic file R/W code.

Goal would be to author a set of mini-walkthroughs describing each useful 'thing' you can do with FO APIs. Ex:

  • Connect to DUT
  • Copy files
  • Install & run apps
  • Monitor task/tasklist status with ServerPollers
  • Create tasks/tasklists
  • Execute tasks/tasklists
  • Interact with running tasks/tasklists (esp external tasks)
  • Execute programs outside of a task
  • Interact with containers

Remove Windows service workaround

Issue is due to dotnet/runtime#50020

Workaround is documented in issue above, but requires a fork of behavior between Windows Service and Windows applications (likely by checking for an extra argument passed in to the service mode)

Consider reworking *BootTasks & InitialTaskLists settings to be more understandable

https://microsoft.github.io/FactoryOrchestrator/service-configuration/

These 3 settings are hard to understand how to use, and have a lot of overlap. We should consider:

  • Consolidate into one single file.
  • New TaskList attributes in XML (properties in C#) to denote if the tasklist is a first boot or every boot tasklist.
  • All Tasks/TaskLists are returned by QueryTask(), GetTaskListGuids() & similar APIs.
  • Consider deprecating GetBootTaskList* APIs.
  • App UI shows all TaskLists, but divides between boot and non-boot, or has a UI toggle. This should be done no matter what :)

Task support for rebooting into an EFI Application

Not all actions needed happen in the HL OS. It would be great to understand if we can find a way to orchestrate:

  1. Take an EFI Application from disk / somewhere
  2. place it into a FAT32 / shared location
  3. setup the system to boot to the EFI Application on next boot.

one example of this could be rebooting into EFI Shell and running some commands.

Folder transfer from remote service to local app fails with 0x80070002

Describe the bug
File transfer from a remote FO service to a local app frequently gives Access Denied errors
To Reproduce
Steps to reproduce the behavior:

  1. Install app on Win10 device
  2. Install service on remote device
  3. Connect app to remote device
  4. Ensure file transfer permission is enabled in Settings
  5. Attempt to transfer folder from remote -> local

Expected behavior
Works.

Screenshots
image

Environment (please complete the following information):

  • OS: Win 10
  • Service and/or client version(s): 10.3.0 for both

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.