This is not an officially supported Google product.
Google Cloud Platform shows recommendations for underutilized/overutilized resources. Recomator extends these functionalities by allowing to also apply recommendations with one click and by giving an overview of recommendations for all projects. Customers will be able to deploy a premade package on one of the serverless solutions and run it in AppEngine in their own GCP account.
src/config.ts
contains two web addresses that you should provide:
For testing purposes (using npm run serve
), use the first one.
For production (npm run build
), use the second one.
public static DEVELOPMENT_BACKEND_ADDRESS = "http://dev.yourbackend.com";
public static PRODUCTION_BACKEND_ADDRESS = "http://yourbackend.com";
Note: The following commands need to be run in the ./frontend/
directory:
npm install
npm run serve
npm run build
npm run test:unit
npm run lint
-
Create a project on GCP.
-
Make sure that the APIs listed below are Enabled:
-
Go to App Engine page.
-
Click
create application
.
- Choose preferred region, language -
Go
, environment -standard
.
Note that you don’t need to install it, if you are using Cloud Shell. Otherwise, to install you need to follow this tutorial https://cloud.google.com/sdk/docs/install
Run the following commands:
git clone https://github.com/googleinterns/recomator
cd recomator
gcloud init
You will be asked to choose an account and project. Choose the project in which you created the app.
Now run
gcloud app describe | grep defaultHostname
You will see the value of defaultHosthame (your future app address).
Copy it, you’ll need it in the next step.
-
Go to APIs & Services -> OAuth consent screen.
-
Choose your app’s name, support email.
-
Click
Add domain
and add the address of your app (from previous section, last step). -
Add developer’s email address and click
Save & continue
. -
Add scopes:
.../auth/userinfo.email
.../auth/cloud-platform
-
Click
Save
, thenBack to dashboard
. -
Go to Credentials-> Create Credentials -> OAuth client ID
-
Choose
Web application
-
Add authorized URI:
https://<YOUR APP ADDRESS>/auth
, where<YOUR APP ADDRESS>
is the address of your application. -
Copy clientID and clientSecret.
- Install npm https://www.npmjs.com/get-npm
- Go to your app directory (the one where you cloned the recomator repository).
- Set up some environmental variables:
export CLIENT_ID=<YOUR CLIENT ID>
export CLIENT_SECRET=<YOUR CLIENT SECRET>
export APP_ADDRESS=<YOUR ADDRESS>
- Set up configs:
echo "{\"clientID\":\"$CLIENT_ID\",\"clientSecret\":\"$CLIENT_SECRET\",\"redirectURL\":\"https://$APP_ADDRESS/auth\"}" > config.json
echo "VUE_APP_BACKEND_ADDRESS=https://$APP_ADDRESS/api" > frontend/.env
- Build frontend:
cd frontend
npm install
npm run build
- Deploy the app:
cd ..
cat deploy_gcloudignore.txt >> .gcloudignore
gcloud app deploy
Every file containing source code must include copyright and license information. This includes any JS/CSS files that you might be serving out to browsers. (This is to help well-intentioned people avoid accidental copying that doesn't comply with the license.)
Apache header:
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.