GithubHelp home page GithubHelp logo

aca-jobs's Introduction

aca-jobs

Running scheduled jobs on Azure Container Apps.

Three ways

  • as ACA job
  • using DAPR binding
  • hosting Functions on ACA (cron binding not available in public preview)

Build and local tests

cd src\hellocron\hellocontroller

dapr run --app-id dothejob --app-port 7220 --dapr-http-port 3500 --app-ssl --components-path ../daprconfig -- dotnet run --launch-profile https

Build Docker container for the API

cd src\hellocron

docker build . --tag hello-controller:0.1.2 --file .\hellocontroller\Dockerfile --no-cache

docker run -p 8080:80 --detach hello-controller:0.1.2 

curl -iv http://localhost:8080/DoTheJob

Build Docker container for the worker

cd src\hellocron

docker build . --tag hello-worker:3.4.5 --file .\helloworker\Dockerfile --no-cache

docker run --detach hello-worker:3.4.5

docker ps

docker log <containerid>

Provision the test infrastructure

az login --tenant <TID>
az account set --subscription <SID>
cd infra/aca

sh deploy.sh

Push apps to the registry

Worker - Tag and Push the images to the registry.

cd src\hellocron

# Tag
docker tag hello-worker:3.4.5 acajobs.azurecr.io/hello-worker:3.4.5

# Login
az acr login --name acajobs 

# Push
docker push acajobs.azurecr.io/hello-worker:3.4.5

az acr repository list --name acajobs -o table

API

cd src\hellocron

# Tag
docker tag hello-controller:0.1.2 acajobs.azurecr.io/hello-controller:0.1.2

# Login
az acr login --name acajobs

# Push
docker push acajobs.azurecr.io/hello-controller:0.1.2

Deploy the demo app and the job

cd aca/infra

sh deploy.sh

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.