Giter Site home page Giter Site logo

googlecloudplatform / appengine-plugins Goto Github PK

View Code? Open in Web Editor NEW
36.0 28.0 24.0 2.98 MB

A client Java library to manage App Engine Java applications for any project that performs App Engine Java application management. For example, the Maven, Gradle and Eclipse App Engine plugins, custom user tools, etc.

License: Apache License 2.0

Java 99.33% Shell 0.65% Batchfile 0.03%
java appengine-java appengine appengine-sdk gcloud gcloud-sdk cloud-sdk

appengine-plugins's Introduction

experimental

Google App Engine Plugins Core Library

IMPORTANT: This library is used by Google internal plugin development teams to share App Engine related code. Its use for any other purpose is highly discouraged and unsupported. Visit our App Engine documentation for more information on Google supported clients for App Engine administration.

Requirements

This library requires Java 1.8 or higher to run. This library requires Maven and Java 1.8 or higher to build.

You must also install the Cloud SDK command line interface (gcloud). If it isn't installed yet, follow these instructions.

You must also install the app-engine-java component:

gcloud components install app-engine-java

Supported operations

The library implements the following operations:

  • Deploy an application to standard or flexible environment
  • Stage an application for deployment
  • Run an application on the local server synchronously or asynchronously

How to use

Build the library using the "mvn clean install" command at the repository root directory, where the pom.xml file is located. This produces the appengine-plugins-core-version-SNAPSHOT.jar file in the "target" directory that you can add to your application's class path.

To deploy a new version, a client calls the library in the following way:

// All operations require the cloud SDK
CloudSdk cloudSdk = new CloudSdk.Builder().sdkPath(some-path).javaHome(some-java-home).build();


// Operations that use gcloud command line are initiated by the Gcloud object.
Gcloud gcloud = Gcloud.builder(sdk).setMetricsEnvironment("asdf","12").setCredentialFile(some-file).build()

// Similarly for AppCfg and the DevAppServer
AppCfg appcfg = AppCfg.builder(sdk).build()
DevServers localRun = DevServers.builder(sdk).build()

// Operations are started as processes, access to these processes is handled
// by implementations of ProcessHandler. To continue to interface with processes
// as before, use LegacyProcessHandler.
ProcessHandler handler = LegacyProcessHandler.builder()...configureHandler...build();
gcloud.newDeployment(handler).deploy(myDeployConfiguration);

SDK Manager

This library provides a mechanism for installing, adding components to, and updating the Cloud SDK. The operations are intended to run asynchronously, either on an executor or through mechanisms provided by an IDE.

// Create a new Managed SDK instance
ManagedCloudSdk sdk = ManagedCloudSdk.newManagedSdk("123.123.123") // SDK fixed at version.
ManagedCloudSdk sdk = ManagedCloudSdk.newManagedSdk() // 'LATEST' sdk, can be updated.

// Implement the listener interface to listen to operation output
MessageListener listener = new MessageListener() {...};

// Always check if operations are needed before running them
if (!sdk.isInstalled()) {
  sdk.newInstaller().install(listener);
}

// use SdkComponent to reference a Cloud Sdk component
if (!sdk.hasComponent(SdkComponent.APP_ENGINE_JAVA)) {
  sdk.newComponentInstaller().installComponent(SdkComponent.APP_ENGINE_JAVA, listener);
}

// updates will only occur on 'LATEST' sdks
if (!sdk.isUpToDate) {
  sdk.newUpdater().update(listener);
}

// You can then create an SDK from a managed SDK instance
new CloudSdk.Builder().sdkPath(sdk.getSdkHome())...;

appengine-plugins's People

Contributors

abbiefarr avatar akerekes avatar briandealwis avatar chanseokoh avatar coollog avatar ddixit14 avatar dependabot[bot] avatar elefeint avatar elharo avatar emmileaf avatar etanshaul avatar ivanporty avatar joaoandremartins avatar joewang1127 avatar loosebazooka avatar lqiu96 avatar ludoch avatar martinbonnin avatar meltsufin avatar mpeddada1 avatar msuozzo avatar nkibler avatar patflynn avatar peterlin741 avatar release-please[bot] avatar ruomengz avatar suztomo avatar tadcordle avatar twisterrob avatar zhumin8 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

Watchers

 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

appengine-plugins's Issues

Ensure artifacts have the correct file permissions

After staging a flexible style project, we need to ensure the artifact is readable by everyone or the user launching it inside the docker wont be able to run it. Deploys fail to verify the vm is running and an 502 is presented when trying to hit the url.

Should AppEngineSdk be merged with CloudSdk?

Since App Engine SDK can now be bundled with Cloud SDK, there doesn't seem to be a need for the users to provide a Cloud SDK path and an App Engine SDK path separately. That being the case, should we just merge AppEngineSdk with CloudSdk, and simply move the AppEngineSdk.runCommand() to CloudSdk?

Allow passing in auth context to supported gcloud operations

For consumers of this API that can't rely on having to do gcloud auth login there needs to be a way to pass in the auth context.

An initial solution could be to support the --credential-file-override flag and require consumers to do the staging of the credential file themselves.

Implement standard GAE staging

We're currently depending on the App Engine SDK to stage standard GAE apps. (i.e., AppCfg.main()).

We should implement staging in the library, cutting the App Engine SDK dependency and also the SdkResolver one (which makes us set a system property with the GAE SDK root folder).

Provide default configuration implementations for every action

Package com.google.cloud.tools.app.config contains interfaces for each action's configuration.

Maven and Gradle will have implementations of their own, but the library should provide a default implementation for other clients which don't have any implementation. These implementations should probably use builder syntax.

e.g., DefaultDeleteConfigurationImpl.newDeleteConfiguration(requiredParam1, requiredParam2)
.optionalParam1(p1)
.optionalParam2(p2)

Support for EAR based project staging and error messaging

Currently this lib does not support staging and deployment for EAR based projects. The user is shown an error message indicating this, but the message does not provide any workaround suggestions.

If it doesn't make sense to add in this support then perhaps we should expand the error message guiding the user: i.e. deploy the modules individually instead.

Motivation: the IJ legacy App Engine plugin does support ear plugins.

Make AppEngineException checked

This indicates an unpredictable environmental condition, not a program bug. This is exactly what checked exceptions were designed for.

Ensure integration tests pass

Identified scenarios that require validation:

Deploy normal Maven app with web.xml (guestbook)
Deploy normal Maven app with vm=true in appengine-web.xml (guestbook)
Deploy pure Java8 app without appengine-web.xml (sparkjava)
Deploy JAR and WAR apps, with/without appengine-web.xml
Test on Windows
Test with no authentication in gcloud
Test with no project set in gcloud
Test without gcloud

We could also test these scenarios in bugouts and new releases.

windows testing

Make sure everything works on windows.

  • Gcloud actually runs
  • All our pathing is OS agnostic
  • Stage Flex sets the correct file permissions

Add --format flag support

For some clients its useful to be able to control the output format of cammand via the --format flag. For example --format=json so that the output is easily parseable.

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.