I have production GAE application - myapp. I've created also second app - myapp-staging to have separate, staging environment.
In myapp I've created Jenkins machine to get Build pipeline.
It's easy to run test and deploy jobs on the same app. But there is a problem with deploy version from Jenkins VM on myapp to myapp-staging. I got unknown application (or similar) error while gcloud preview deploy.
Is it possible to give access from VM on one application to another one? Especially for gcloud command?
The problem is that the Jenkins instance is using a service account which is enabled as myapp admin but has no access to myapp-staging . You'll have to either:
1) Setup your original Jenkins with a second service account with admin rights to myapp-staging
2) Setup a second Jenkins instance and trigger the build of the staging version when the first one is complete.
Related
I followed the contents of three different tutorials in deploying a slightly-modified boilerplate React app to Azure App Services. The primary issue I'm having is that while all deployment pipelines and releases have been successful on Azure DevOps, navigating to the page results in the default landing page for non-deployed app services;
Hey, Node developers!
Your app service is up and running.
Time to take the next step and deploy your code.
I'll briefly describe the steps I took to get to this point:
I used create-react-app to generate a basic template, ran all the prerequisite commands, fiddled with the app.js file and its CSS companion, and left index.* untouched.
I pushed all of it with an untouched gitignore to a Github repository.
I created an App Service, running Linux and Node 12 LTS, on the Free plan.
I created a DevOps project, and within it created a Pipeline and a Release Pipeline.
In the Pipeline: I retrieved my repository source via linked accounts in the Get Sources step. In Agent job 1, I added a npm install element, a npm run build element, and a Publish Artifact element. I set the path to build, and artifact name to artifact, publishing to Azure Pipelines.
In the Release Pipeline: I added an artifact that grabs its source from the previous pipeline, and gives a source alias of _artifact. CD trigger is enabled. I added a stage that has a Deploy Azure App Service element, using $(System.DefaultWorkingDirectory)/_artifact/artifact as the package/folder.
When I push a commit or manually trigger the first pipeline, everything succeeds with no obvious errors. The Release pipeline is triggered and also completes without error. Checking the logs, the artifact is stored and accessed accurately. I can see the correct build files being accessed.
In the Azure portal, I can see that deployment has succeeded with the correct timestamp, commit name, and pipelines. However, when I access the actual site, I am shown the generic page.
Am I missing a crucial step somewhere? I've tried navigating to /index.html, /src/index.html, and a bunch of other combinations of known files, but to no avail; Cannot GET /index.html.
Any insight would be appreciated.
For reference, I used these three walkthroughs:
https://medium.com/microsoftazure/deploying-create-react-app-as-a-static-site-on-azure-dd1330b215a5
https://medium.com/#to_pe/deploying-create-react-app-on-microsoft-azure-c0f6686a4321
https://www.pluralsight.com/guides/deploy-a-react-app-to-azure
This question is very simple, you can refer to the following post.
1. Deploy create-react-app with azure pipelines
2. Unable to deploy React JS application on Azure App service
3. Process for React App deployment to Azure Web?
Suggestion:
It is recommended to choose linux when creating a webapp.
Configuration->StartupCommand: pm2 serve /home/site/wwwroot --no-daemon --spa
I am using Google Cloud to deploy my application. I have followed the steps in the documentation for deploying. I deployed early on in my project and it was successful. I then decided to change some files and update some features in my app. For this i followed the documentation for updating a deployment. This update was successful. It had me create the deployment in my Deployment Manager and run the gcloud commands to commence update. When I redeployed with gcloud app deploy, it was successful.
I have since added a couple more lines of code and features in my application. I followed the same documentation for updating a deployment as I had the first time I made an update and it is no longer working for me.
Does anybody have any idea what would be the problem? Again, I was able to successfully deploy, and even update that deployment once by following Google Cloud docs. Now I am having no luck.
Have you been changing the version number? Go to:
https://console.cloud.google.com/appengine/versions?project=< your project name >&serviceId=default
And make sure the version you want is active. Also, you can try:
http://<VERSION>-dot-<SERVICE>-dot-<PROJECT_ID>.<REGION_ID>.r.appspot.com
Example:
https://20200813-dot-myapp.uc.r.appspot.com
if the version number was 20200813 and your appname is myapp and the region is uc
Where is the google app engine home root? I can't seem to find it, I want to edit the source code in there but I just can't. I want to use the default editor but I just can't seem to find the root project or wherever it is that's located at. Do you know where it is?
What you want to do is only possible if you are using App Engine Flex.
For App Engine Flex the deployment gets your files, build a Docker container with them, and then deploys this container inside a VM. As you can see on the documentation, you can connect directly to your container by running:
gcloud app instances ssh [INSTANCE-NAME] --service [SERVICE] --version [VERSION]
docker exec -it gaeapp /bin/bash
Once you run these commands you will be on the root folder of your container and changes you make on files will be reflected on the current running version of your app.
If you are using App Engine Standard, you cannot access the instances since it is a fully managed environment. Therefore you won't be able to find the root of the running app version.
NOTE: For App Engine Standard, since it uses a staging bucket to gather the code before compiling, you are able to get the files themselves but on a pre deployment state, meaning that if you change them it will not reflect on the current running version of your app. You can find your staging bucket through the App Engine Admin API. This bucket is usually staging.<PROJECT_ID>.appspot.com, although you can change this configuration.
I wanted to create an App Engine app using the following command
gcloud app create --project=recommendations-1 --region=asia-east1-b
but system told me:
ERROR: (gcloud.app.create) PERMISSION_DENIED: Operation not allowed
'#type': type.googleapis.com/google.rpc.ResourceInfo
description: The "appengine.applications.create" permission is
required.
resourceType: gae.api
Other information:
I use google cloud shell
before create app, I connect instance with [gcloud compute ssh recommendations-1 ]
I wanted to make recommendation system with (https://cloud.google.com/solutions/machine-learning/recommendation-system-tensorflow-deploy)
I have enabled [ App Engine Flexible Environment] and [App Engine Admin API] manually
I have gcloud auth login
I have gcloud config list project
I believe you have already created the project “recommendations-1”. If not, use this command first:
gcloud projects create sample-project-name
If yes, you can start by running the following commands:
gcloud config set project sample-project-name
gcloud app create --project=sample-project-name --region=valid-region
Note that your command contains an invalid region. Check the valid regions here and here or use this command to see the list and choose interactively on the console.
gcloud app create
The issue you are having is most probably because you are trying to create an application in a project (recommendations-1) from within another project causing the permission errors.
You can have two machines running at the same time. As shown here the VM that you access when using Cloud Shell is the active VM of the current project in the Cloud Console, so in case you access another VM with “gcloud compute ssh” in a terminal, you may be accessing different VMs. It will depend on which VM is set up on each tool.
So in case you are trying to create an app in the project “recommendations-1” using Cloud Shell, Cloud SDK or another tool, you will need to set "recommendations-1" as the current project in that tool by using the “gcloud config set project recommendations-1” command. If the Cloud Console current project is already set to "recommendations-1", Cloud Shell will automatically be set with this project. Otherwise, you do not have access to create an app in a project from within the instance of another project.
I cannot stop or delete versions of a project created as it was created as a flexible environment within the EU. I understand the restriction by region but cannot work out why it cannot be removed.
jamie#dartmoor-1320:~$ gcloud preview app versions delete 20160607t131220
Deleting the following versions:
- dartmoor-1320/default/20160607t131220
Do you want to continue (Y/n)?
Deleting [default/20160607t131220]...failed.
ERROR: (gcloud.preview.app.versions.delete) Issue deleting version: [default/20160607t131220]
[default/20160607t131220]: Error Response: [13] Managed VMs can not be hosted in the application's region. (e~))
The GUI fails too but with a non descript error message.
You have to have at least one version for the default module. That's the reason why it doesn't allow you to delete it.
You need to deploy a new version, it can be a Flexible VM (deployed to another region in your situation), or Standard VM.
As a workaround, when you don't have any app to replace it right now, you can deploy an empty app instead. You have to create an app.yaml:
---
runtime: python38
handlers:
- url: /
script: auto
and deploy it using:
gcloud app deploy app.yaml
As your app.yaml doesn't have any script to execute, you'll not be charged for any instance.
If you want to stop app engine you can disable it App Engine -> Settings -> Disable application
This will only stop traffic to you Application after that you can remove the instances.