Build your repo automatically.
Перейти к файлу
Paul Dorsch 7609df04ce
Add job to move sdks from prod to another storage account (#1499)
* Job to revert dev sdks to what is in prod

* renamed

* renamed various files and functions to be clearer and demonstrate functionality better

* added new sdk storage constant for sandbox account

* corrected storage account constant and updated copy script

* finalized logic to copy entire blob container to new storage account

* updated sdks job to have a dry run parameter, and to have actual parameters instead of variables

* made dry run default in case of empty val

* Pauld/sandbox to prod (#1501)

* Point python 3.6 get-pip to new source (#1498)

* add additional logic for python 3.6 download, pointing at another get-pip source

* fixed placement

* added pipeline that copies from a source storage account to the production one

* added parameters and dry run capabilities

* add clearer error message in case of bad argument
2022-08-08 12:44:32 -04:00
.github Adding code owners file to automatically add code reviewers 2019-03-19 14:40:30 -07:00
.vscode Use template for generating .NET Core build script and also enable it to be part of a multi-platform build. (#571) 2020-05-07 06:02:02 -07:00
acr-tasks add scheduled acr-tasks for cleaning up repositories (#634) 2020-06-12 11:27:04 -07:00
actions/oryx-dockerfile Add oryx-dockerfile GitHub Action to repository (#483) 2020-02-19 14:13:47 -08:00
build Add job to move sdks from prod to another storage account (#1499) 2022-08-08 12:44:32 -04:00
doc Snehapar/1580390 upgrade php to 7.4.30 and apache2 to 2.4.54 (#1500) 2022-08-04 14:45:04 -07:00
images Add job to move sdks from prod to another storage account (#1499) 2022-08-08 12:44:32 -04:00
platforms Snehapar/1580390 upgrade php to 7.4.30 and apache2 to 2.4.54 (#1500) 2022-08-04 14:45:04 -07:00
src Add job to move sdks from prod to another storage account (#1499) 2022-08-08 12:44:32 -04:00
tests Update integration jobs and constant files (#1470) 2022-07-21 18:37:05 -07:00
vsts Add job to move sdks from prod to another storage account (#1499) 2022-08-08 12:44:32 -04:00
.dockerignore Fixing Golang code workspace and other minor things (#216) 2019-06-22 05:25:14 -07:00
.gitattributes
.gitignore fix python and node integration tests (#793) 2020-09-26 20:51:19 -07:00
CHANGELOG.md Adding automatic release notes from changelog file. (#16) 2019-03-25 17:04:40 -07:00
CODE_OF_CONDUCT.md Add missing documentation needed for licensing guidelines in OSS projects (#1362) 2022-04-28 09:15:06 -07:00
CONTRIBUTING.md Merged PR 168870: add notes on tracking updates, move architecture doc 2019-03-14 22:24:05 +00:00
CodeMaid.config Merged PR 158974: Updating license headers per CELA. 2019-01-14 22:46:29 +00:00
Detector.sln Detector: Make only few types public and the rest internal (#648) 2020-06-25 06:44:34 -07:00
Directory.Build.props Add initial code analysis and rulesets for repository (#1278) 2022-03-15 09:00:04 -07:00
Directory.Build.targets Add initial code analysis and rulesets for repository (#1278) 2022-03-15 09:00:04 -07:00
LICENSE.md
Oryx.sln Prefix instance variables with 'this' and remove underscore prefixes (#1301) 2022-03-25 08:41:34 -07:00
README.md Add missing documentation needed for licensing guidelines in OSS projects (#1362) 2022-04-28 09:15:06 -07:00
SECURITY.md Add missing documentation needed for licensing guidelines in OSS projects (#1362) 2022-04-28 09:15:06 -07:00
SUPPORT.md Add missing documentation needed for licensing guidelines in OSS projects (#1362) 2022-04-28 09:15:06 -07:00
ThirdPartyNotice.txt Add third party notice (TPN) document (#1363) 2022-04-27 11:28:02 -07:00

README.md

Oryx

Build Status

Oryx is a build system which automatically compiles source code repos into runnable artifacts. It is used to build web apps for Azure App Service and other platforms.

To receive updates on runtimes and versions supported by Oryx and App Service, subscribe to Azure Updates or watch the github.com/Azure/app-service-announcements tracker.

Oryx generates and runs an opinionated build script within a build container based on analysis of a codebase's contents. For example, if package.json is discovered in the repo Oryx includes npm run build in the build script; or if requirements.txt is found it includes pip install -r requirements.txt.

Oryx also generates a run-time startup script for the app including typical start commands like npm run start for Node.js or a WSGI module and server for Python.

The built artifacts and start script are loaded into a minimalistic run container and run.

Supported platforms and versions

Link

Patches (0.0.x) are applied as soon as possible after they are released upstream.

Get started

Though built first for use within Azure services, you can also use the Oryx build system yourself for troubleshooting and tests. Following are simple instructions; for complete background see our architecture doc.

Oryx includes two command-line applications; the first is included in the build image and generates a build script by analyzing a codebase. The second is included in run images and generates a startup script. Both are aliased and accessible as oryx in their respective images.

oryx build

When oryx build is run, the system detects which programming platforms appear to be in use and applies toolsets appropriate for each one. You can override the default choices through configuration.

The --output (or -o) parameter specifies where prepared artifacts will be placed; if not specified the source directory is used for output as well.

For all options, specify oryx --help.

oryx create-script -appPath

When oryx is run in the runtime images it generates a start script named run.sh, by default in the same folder as the compiled artifact.

Support for Build Configuration File

You can provide some extra build related information in an appsvc.yaml in your content root directory. The build configuration supports 2 sections

  1. pre-build
  2. post-build

This is how a sample appsvc.yaml looks like

version: 1

pre-build: | 
    apt install curl
  
post-build: | 
    python manage.py makemigrations 
    python manage.py migrate

Oryx will read the yaml and run the commands provided for pre-build and post-build.

Build and run an app

To build and run an app from a repo, follow these approximate steps. An example script follows.

  1. Mount the repo as a volume in Oryx's docker.io/oryxprod/build container.
  2. Run oryx build ... within the repo directory to build a runnable artifact.
  3. Mount the output directory from build in an appropriate Oryx "run" container, such as docker.io/oryxprod/node-10.14.
  4. Run oryx ... within the "run" container to write a startup script.
  5. Run the generated startup script, by default /run.sh.
# Run these from the root of the repo.
# build
docker run --volume $(pwd):/repo \
    'mcr.microsoft.com/oryx/build:latest' \
    oryx build /repo --output /repo

# run

# the -p/--publish and -e/--env flags specify and open a host port
docker run --detach --rm \
    --volume $(pwd):/app \
    --env PORT=8080 \
    --publish 8080:8080 \
    'mcr.microsoft.com/oryx/node:10' \
    sh -c 'oryx create-script -appPath /app && /run.sh'

Build Server Invocation

  1. Build the Oryx solution
    1. Build Solutionpng
  2. Create image with oryx and platform binaries
    1. time build/buildBuildImages.sh -t ltsversion
  3. Run docker to port map, volume mount a directory, specify the image with oryx build, and invoke BuildServer
    1.  docker run -it -p 8086:80 \
       -v C:\Repo\Oryx\tests\SampleApps\:/tmp/SampleApps \
       -e "ASPNETCORE_URLS=http://+80" \
       oryxdevmcr.azurecr.io/public/oryx/build:lts-versions \
       /opt/buildscriptgen/BuildServer
      
      Start
  4. Invoke build
    1. Post
      1. Under the hood oryx build is invoked
        oryx build [sourcePath] \
            --platform [platform] \
            --platform-version [version] \
            --output [outputPath] \
            --log-file [logPath]
        
  5. Check build status with id 1
    1. Status
  6. Check server healthcheck
    1. Health Check

Components

Oryx consists of a build image, a collection of runtime images, a build script generator, and a collection of startup script generators. For more details, refer to our architecture page.

Testing Locally

startup script generator

build/testStartupScriptGenerators.sh will perform tests on all startup script generators written in go. The tests are copied into a docker image for performing go test on all platforms.

Contributing

See CONTRIBUTING.md.

License

MIT, see LICENSE.md.

Security

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

Trademark

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsofts Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-partys policies.

Data/Telemetry

When utilized within Azure services, this project collects usage data and sends it to Microsoft to help improve our products and services. Read Microsoft's privacy statement to learn more.

This project follows the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ. Contact opencode@microsoft.com with questions and comments.

Disable Data Collection

To prevent Oryx command line tools from collecting any data, set the environment variable ORYX_DISABLE_TELEMETRY to true.