Compose CLI ACI Integration Now Available

Today we are pleased to announce that we have reached a major milestone, reaching GA and our V1 of both the Compose CLI and the ACI integration.

In May we announced the partnership between Docker and Microsoft to make it easier to deploy containerized applications from the Desktop to the cloud with Azure Container Instances (ACI). We are happy to let you know that all users of Docker Desktop now have the ACI experience available to them by default, allowing them to easily use existing Docker commands to deploy and manage containers running in ACI.

As part of this I want to also call out a thank you to the MSFT team who have worked with us to make this all happen! That is a big thank you to Mike Morton, Karol Zadora-Przylecki, Brandon Waterloo, MacKenzie Olson, and Paul Yuknewicz.

**Getting started with Docker and ACI **

As a new starter, to get going all you will need to do is upgrade your existing Docker Desktop to the latest stable version (2.5.0.0 or later), store your image on Docker Hub so you can deploy it (you can get started with Hub here) and then lastly you will need to create an ACI context to deploy it to.

We have done a few blog posts now on the different types of things you can achieve with the ACI integration.

If you have other questions on the experience or would like some other guides then drop us a message in the Compose CLI repo so we can update our docs.

**What’s new in V1.0 **

Since the last release of the CLI we have added a few new commands to make it easier to manage your working environment and also make it simpler for you to understand what you can clear up to save you money on resources you are not using.

To start we have add a volume inspect command alongside the volume create to allow you better management of your volumes:

We are also very excited by our new top level prune command to allow you to better clear up your ACI working environment and manage your costs.

docker prune --help

We have also added in a couple of interesting flags in here, we have the —dry-run flag to let you see what would be cleared up:

(OK I am not running a great deal here!)

As you can see, this also lets you know the amount of compute resources you will be reclamining as well. At the end of a development session being able to do a force prune allows you to remove ‘all the things you have run’, giving you the confidence you won’t have left something running and get an unexpected bill.

Lastly we have started to add a few more flags in based on your feedback, a couple of examples of these are the addition of the --format json and --quiet in commands ps, context ls, compose ls, compose ps, volume ls to output json or single IDs.

We are really excited about the new experience we have built with ACI, if you have any feedback on the experience or have ideas for other backends for the Compose CLI please let us know via our Public Roadmap

The Original Article can be found on docker.com

#Products #ACI #Compose #containers #docker #Microsoft

What is GEEK

Buddha Community

Compose CLI ACI Integration Now Available

Compose CLI ACI Integration Now Available

Today we are pleased to announce that we have reached a major milestone, reaching GA and our V1 of both the Compose CLI and the ACI integration.

In May we announced the partnership between Docker and Microsoft to make it easier to deploy containerized applications from the Desktop to the cloud with Azure Container Instances (ACI). We are happy to let you know that all users of Docker Desktop now have the ACI experience available to them by default, allowing them to easily use existing Docker commands to deploy and manage containers running in ACI.

As part of this I want to also call out a thank you to the MSFT team who have worked with us to make this all happen! That is a big thank you to Mike Morton, Karol Zadora-Przylecki, Brandon Waterloo, MacKenzie Olson, and Paul Yuknewicz.

**Getting started with Docker and ACI **

As a new starter, to get going all you will need to do is upgrade your existing Docker Desktop to the latest stable version (2.5.0.0 or later), store your image on Docker Hub so you can deploy it (you can get started with Hub here) and then lastly you will need to create an ACI context to deploy it to.

We have done a few blog posts now on the different types of things you can achieve with the ACI integration.

If you have other questions on the experience or would like some other guides then drop us a message in the Compose CLI repo so we can update our docs.

**What’s new in V1.0 **

Since the last release of the CLI we have added a few new commands to make it easier to manage your working environment and also make it simpler for you to understand what you can clear up to save you money on resources you are not using.

To start we have add a volume inspect command alongside the volume create to allow you better management of your volumes:

We are also very excited by our new top level prune command to allow you to better clear up your ACI working environment and manage your costs.

docker prune --help

We have also added in a couple of interesting flags in here, we have the —dry-run flag to let you see what would be cleared up:

(OK I am not running a great deal here!)

As you can see, this also lets you know the amount of compute resources you will be reclamining as well. At the end of a development session being able to do a force prune allows you to remove ‘all the things you have run’, giving you the confidence you won’t have left something running and get an unexpected bill.

Lastly we have started to add a few more flags in based on your feedback, a couple of examples of these are the addition of the --format json and --quiet in commands ps, context ls, compose ls, compose ps, volume ls to output json or single IDs.

We are really excited about the new experience we have built with ACI, if you have any feedback on the experience or have ideas for other backends for the Compose CLI please let us know via our Public Roadmap

The Original Article can be found on docker.com

#Products #ACI #Compose #containers #docker #Microsoft

Jerod  Durgan

Jerod Durgan

1625975580

How To Build A Kubernetes Backend In Compose CLI ?

Docker Compose is a great tool from Docker, it is used by millions to deploy and manage multi-containers applications. Docker Compose is basically 2 things:

  • The Compose file is a specification in yaml (named docker-compose.yaml by default) that Docker Compose takes as input. This file defines the components of a containerized application and how they are connected together. It should be written according to the Compose specification whose details are available in this repository
  • Docker Compose is the tool that processes this Compose file: it checks that it is written according to the Compose specification and deploys the application components

Anca Iordache from Docker, explains the move to the Compose Spec into the open and how she has started to develop a kube backend for the Compose CLI as a side project:

“The Compose format is very popular among developers due to its simplicity and there was always a lot of interest in having tools to deploy Compose files on platforms other than a single Docker Engine or Swarm. To make Compose go beyond Docker and Swarm, early in 2020, we opened the Compose specification to enable anybody to build tools around it. We used the new open specification and reference libraries to build support for Amazon ECS and Microsoft ACI into the Docker CLI for deploying Compose apps on these platforms. An obvious next target was Kubernetes as it is highly popular and there is a lot of interest in deploying Compose apps onto it. We wrote an initial proof of concept to test this integration but it hasn’t been added to Docker’s product roadmap yet. I have picked it up as my hack project to continue making progress with this integration. The current code for the Kubernetes backend can be found in the public repository docker/compose-cli and everybody is welcome to contribute to it.”

#kubernetes #docker #docker-compose #compose cli

 Ryleigh Walker

Ryleigh Walker

1594466100

Docker Compose — Now on AWS!

New beta feature Docker-ECS allows direct pushing of Docker Compose to the Aws cloud!

#devops #docker #compose #now #aws

fd MOMIN

fd MOMIN

1655625349

A Simple Flutter API to Manage Rest Api Request Easily

api_manager .A simple flutter API to manage rest api request easily with the help of flutter dio.

Get started

Install

Add dependency

dependencies:
  api_manager: $latest_version

Super simple to use

import 'package:api_manager/api_manager.dart';

void main() async {
 
  ApiResponse response = await ApiManager().request(
    requestType: RequestType.GET,
    route: "your route",
  );
  print(response);
}

Config in a base manager


class ApiRepository {
  
  static final ApiRepository _instance = ApiRepository._internal(); /// singleton api repository
  ApiManager _apiManager;

  factory ApiRepository() {
    return _instance;
  }

  /// base configuration for api manager
  ApiRepository._internal() {
    _apiManager = ApiManager();
    _apiManager.options.baseUrl = BASE_URL; /// EX: BASE_URL = https://google.com/api/v1 
    _apiManager.options.connectTimeout = 100000;
    _apiManager.options.receiveTimeout = 100000;
    _apiManager.enableLogging(responseBody: true, requestBody: false); /// enable api logging EX: response, request, headers etc
    _apiManager.enableAuthTokenCheck(() => "access_token"); /// EX: JWT/PASSPORT auth token store in cache
  }
}

Examples

Suppose we have a response model like this:

class SampleResponse{
  String name;
  int id;

  SampleResponse.fromJson(jsonMap): 
        this.name = jsonMap['name'],
        this.id = jsonMap['id'];
}

and actual api response json structure is:

{
    "data": {
        "name": "md afratul kaoser taohid",
        "id": "id"
    }
}

#Now we Performing a GET request :

 Future<ApiResponse<SampleResponse>> getRequestSample() async =>
      await _apiManager.request<SampleResponse>(
        requestType: RequestType.GET,
        route: 'api_route',
        requestParams: {"userId": 12}, /// add params if required
        isAuthRequired: true, /// by set it to true, this request add a header authorization from this method enableAuthTokenCheck();
        responseBodySerializer: (jsonMap) {
          return SampleResponse.fromJson(jsonMap); /// parse the json response into dart model class
        },
      );

#Now we Performing a POST request :

 Future<ApiResponse<SampleResponse>> postRequestSample() async =>
      await _apiManager.request<SampleResponse>(
        requestType: RequestType.POST,
        route: 'api_route',
        requestBody: {"userId": 12}, /// add POST request body
        isAuthRequired: true, /// by set it to true, this request add a header authorization from this method enableAuthTokenCheck();
        responseBodySerializer: (jsonMap) {
          return SampleResponse.fromJson(jsonMap); /// parse the json response into dart model class
        },
      );

#Now er performing a multipart file upload request :

  Future<ApiResponse<void>> updateProfilePicture(
    String filePath,
  ) async {
    MultipartFile multipartFile =
        await _apiManager.getMultipartFileData(filePath);
    FormData formData = FormData.fromMap({'picture': multipartFile});

    return await _apiManager.request(
      requestType: RequestType.POST,
      isAuthRequired: true,
      requestBody: formData,
      route: 'api_route',
    );
  }

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add api_manager

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):


dependencies:
  api_manager: ^0.1.29

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:api_manager/api_manager.dart';

example/example.dart

//void main() async {
//  ApiManager _apiManager = ApiManager();
//  _apiManager.options.baseUrl = $base_url;
//  _apiManager.responseBodyWrapper("data");
//
//  ApiResponse<List<dynamic>> response = await _apiManager.request(
//    requestType: RequestType.GET,
//    route: $route,
//    responseBodySerializer: (jsonMap) {
//      return jsonMap as List;
//    },
//  );
//  print(response);
//} 

#flutter  #restapi 

A Simple Flutter API to Manage Rest Api Request Easily

api_manager .A simple flutter API to manage rest api request easily with the help of flutter dio.

Get started

Install

Add dependency

dependencies:
  api_manager: $latest_version

Super simple to use

import 'package:api_manager/api_manager.dart';

void main() async {
 
  ApiResponse response = await ApiManager().request(
    requestType: RequestType.GET,
    route: "your route",
  );
  print(response);
}

Config in a base manager


class ApiRepository {
  
  static final ApiRepository _instance = ApiRepository._internal(); /// singleton api repository
  ApiManager _apiManager;

  factory ApiRepository() {
    return _instance;
  }

  /// base configuration for api manager
  ApiRepository._internal() {
    _apiManager = ApiManager();
    _apiManager.options.baseUrl = BASE_URL; /// EX: BASE_URL = https://google.com/api/v1 
    _apiManager.options.connectTimeout = 100000;
    _apiManager.options.receiveTimeout = 100000;
    _apiManager.enableLogging(responseBody: true, requestBody: false); /// enable api logging EX: response, request, headers etc
    _apiManager.enableAuthTokenCheck(() => "access_token"); /// EX: JWT/PASSPORT auth token store in cache
  }
}

Examples

Suppose we have a response model like this:

class SampleResponse{
  String name;
  int id;

  SampleResponse.fromJson(jsonMap): 
        this.name = jsonMap['name'],
        this.id = jsonMap['id'];
}

and actual api response json structure is:

{
    "data": {
        "name": "md afratul kaoser taohid",
        "id": "id"
    }
}

#Now we Performing a GET request :

 Future<ApiResponse<SampleResponse>> getRequestSample() async =>
      await _apiManager.request<SampleResponse>(
        requestType: RequestType.GET,
        route: 'api_route',
        requestParams: {"userId": 12}, /// add params if required
        isAuthRequired: true, /// by set it to true, this request add a header authorization from this method enableAuthTokenCheck();
        responseBodySerializer: (jsonMap) {
          return SampleResponse.fromJson(jsonMap); /// parse the json response into dart model class
        },
      );

#Now we Performing a POST request :

 Future<ApiResponse<SampleResponse>> postRequestSample() async =>
      await _apiManager.request<SampleResponse>(
        requestType: RequestType.POST,
        route: 'api_route',
        requestBody: {"userId": 12}, /// add POST request body
        isAuthRequired: true, /// by set it to true, this request add a header authorization from this method enableAuthTokenCheck();
        responseBodySerializer: (jsonMap) {
          return SampleResponse.fromJson(jsonMap); /// parse the json response into dart model class
        },
      );

#Now er performing a multipart file upload request :

  Future<ApiResponse<void>> updateProfilePicture(
    String filePath,
  ) async {
    MultipartFile multipartFile =
        await _apiManager.getMultipartFileData(filePath);
    FormData formData = FormData.fromMap({'picture': multipartFile});

    return await _apiManager.request(
      requestType: RequestType.POST,
      isAuthRequired: true,
      requestBody: formData,
      route: 'api_route',
    );
  }

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add api_manager

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):


dependencies:
  api_manager: ^0.1.29

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:api_manager/api_manager.dart';

example/example.dart

//void main() async {
//  ApiManager _apiManager = ApiManager();
//  _apiManager.options.baseUrl = $base_url;
//  _apiManager.responseBodyWrapper("data");
//
//  ApiResponse<List<dynamic>> response = await _apiManager.request(
//    requestType: RequestType.GET,
//    route: $route,
//    responseBodySerializer: (jsonMap) {
//      return jsonMap as List;
//    },
//  );
//  print(response);
//} 

Download Details:

Author: afratul-taohid

Source Code: https://github.com/afratul-taohid/api_manager

#flutter  #restapi