This is the first time I'm working on Google Cloud Functions. I've created a http trigger cloud function using .Net6 framework and trying to deploy it using gcloud Cli. The deployment was failing, and I know why but don't know how to solve it.
I've couple of cs-projects, Cloud Functions project (CFP), Application Services project (ASP) and DBRepositories project (DBP). CFP has a reference of ASP which then has a reference of DBP. I've initiated the deployment from the directory of where Function1.cs(CFP) located. The deployment was unable to locate the other two projects rereferred to CFP.
Project reference visualization:
CloudFunctions.csproj <- ApplicationServices.csproj <- DBRepositories.csproj
I even initiated the deployment from the directory where solution file is located but failed with error "Too many projects found."
Cli command:
gcloud functions deploy demo-function --entry-point HelloFunction.Function1 --runtime dotnet6 --trigger-http --allow-unauthenticated --gen2 --region us-central1
I'm stuck here, any help greatly appreciated. TIA
Related
I get the above error after running mvn -DskipTests package appengine:deploy. Here's the whole error:
Exception calling IAM: There were concurrent policy changes. Please retry the whole read-modify-write with exponential backoff. The request's ETag '\007\005\364\274\033.\262\307' did not match the current policy's ETag '\007\005\364\274\033\177\220\315'.
From my reading, this occurs when there multiple policy changes at the same time. The other questions I've seen throw this error in regard to a POST request but this is to do with an appengine:deploy
What IAM policy does the service account need to work?
This is the IAM account that I believe was created by the appengine:deploy process and it's permissions:
Note - I don't think it's applicable but I added this deploy to appengine step to a Spring Boot app speakiong to a Postgres db.
EDIT
As mentioned in the comment, #Robina's answer has moved me along but not the logs show this error:
UnsupportedClassVersionError: org/springframework/boot/loader/JarLauncher has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtome only recognizes class file version up to 55.0
But setting the java version to 17 throws a build error; here's my appengine.yaml:
runtime: java11
instance_class: F1
EDIT 2
I came across this while reading through the Google guide here which said:
Deploying an executable JAR
Use any build framework to build an executable JAR locally, then do one of the following depending on whether you created an app.yaml file for your app:
If you created an app.yaml file:
Copy the file into the same directory as the executable JAR file you created.
From the directory that contains the app.yaml and your JAR, enter the following command:
gcloud app deploy
gcloud app deploy will create an app.yaml file that contains the
minimum settings, using all default values.
I thought, why not? So I deleted the appengine folder and its app.yaml and then ran the command from above, minus the jar:
gcloud app deploy
After, probably 10 minutes of the command running the app was deployed and points to the Postgres database without any problems. Thanks #Robina for the help!
The service account must have the App Engine Deployer role in order to deploy an application to App Engine. The IAM policy needed for the service account to function depends on what it is used for. Your application is probably being deployed to Google App Engine using the service account if you are using appengine:deploy.
A gcloud command example for granting the role:
gcloud projects add-iam-policy-binding [PROJECT_ID] --member=serviceAccount:[SERVICE_ACCOUNT_EMAIL] --role=roles/appengine.deployer
[PROJECT ID] and [SERVICE ACCOUNT EMAIL] should be changed to reflect your project ID and service account email, respectively.
Similar to this lonely questioner I'm trying to install a Python package from a private PyPI repo such that it's available to our Google Cloud Composer Airflow instance.
I've followed these instructions but Airflow continues not to know about my package:
No module named 'foopackage'
I can't find any reference to my pip.conf in any logs anywhere so I'm not sure whether the file is in the right place, or has the right contents.
How can I proceed with debugging this problem?
The Cloud Composer environment logs show that there was a problem with copying pip.conf from the bucket, but don't give any other details:
{
insertId: "16qa4c8g540zxs3"
logName: "projects/{my-env}/logs/composer-agent"
receiveTimestamp: "2020-02-06T15:59:03.164564368Z"
resource: {…}
severity: "ERROR"
textPayload: "Copying gs://{my-bucket}/config/pip/pip.conf...
"
timestamp: "2020-02-06T15:59:00.857642186Z"
}
I first thought this might be a permissions issue, but the file seems to have the same set of permissions as other files in this bucket.
Where can I get more detailed information on what went wrong when copying that file?
update
I'm on composer-1.7.2-airflow-1.10.2.
update
The service account for my Composer environment already has the project.editor role.
This is an indicator that the Docker image used for the web server failed to build. To find the root cause, please view Cloud Build logs in project.
The reason for this, is a failed or taking long time operation, it timed out on the Composer’s backend. In some cases these errors persist in the backend, blocking future attempts. You can try re-enabling the API:
First solution that comes to my mind is running following commands in cloud shell:
gcloud services disable composer.googleapis.com
gcloud services enable composer.googleapis.com
After enabling the API, please update your Composer environment as usual.
When you install packages, the Composer environment re-creates Docker containers for the Airflow workers and scheduler, then performs a rolling update within the GKE cluster to update the workers to keep workers available. You can check Kubernetes Engine > Workloads to see if your environment timed out because of waiting for the scheduler and workers to come back online.
When Composer environment is using a custom service account and does not have IAM access to use Cloud Build, builds will fail immediately, so please check it. You can diagnose these by going to Cloud Build > History, and when you see builds without a log, it means that builds failed even before trying to build a container.
When your package implement bindings, it will fail at runtime if the libraries don't exist on the system. This means it is incompatible with Cloud Composer, because getting shared libraries into the build environment is not currently supported.
Another thing, make sure if your project is packed in correct way.
I hope you find the above pieces of information useful.
We have configured IBM Cloud Private 2.1.0.3
We have sample node application. We need to deploy the same in ICP console.
We have followed the procedures listed in the below link.
https://www.ibm.com/support/knowledgecenter/SSBS6K_2.1.0.3/app_center/create_helm_cli.html
Please suggest suitable methods.
to deploy an application, you can deploy using
cli
ICP UI
CLI
using helm chart you created
i have a sample project where I shows a java app how it is package and deploy, hopes it helps
https://github.com/ibmcloudprivate2/wildfly
using deployment file
UI
using helm chart you created and added into the UI catalog and deploy using it
see above .
using deployment and service
the following project, i have package a ng sample and shows how to deploy using the UI Workloads/Deployment/Create Deployment and Network Access/Services/Create Service
https://github.com/ibmcloudprivate2/ng4-admin
hopes it helps.
We are installing Open Loyalty Program on to the Google Cloud. Please Google Open Loyalty by Divante Ltd.
We have been trying to deploy this application on google cloud using Kubernetes.
The instance used to deploy this application contains Debian v4.9 as its OS. And we installed Docker, GCloud, Kubernetes and Kompose as the tools for deployment. We built two docker images for the frontend and backend and linked them to the docker-compose file. Now in frontend image, we used (node:5) image from docker hub in Dockerfile of the frontend.
We also changed the docker-compose file as seen below:
enter image description here
After changing the docker-compose file, we ran “kompose up” within the same directory.
which created the deployment and service ‘yaml’ file and then proceeded to run it.
We have pods as given below, but the frontend pod shows some error and some logs.enter image description here
It says yarn not found. When we execute the same process on a local machine, it works as expected.
We are also trying to seek help from Google Support but your help and suggestions will also be highly appreciated.
Yarn is available from node:6. Your front-end image is too old.
I have the following manifest.yml file for a WAR file deployment to Liberty on Cloud Foundry-based Bluemix. When I use the deploy stage from the pipeline to my own workspace, the declared services and service bindings to the app from my manifest file are ignored. However, when using the Deploy to Bluemix button, the dependent services and bindings are created.
How can I force the deploy stage to create and bind services if they don't exist in the space when NOT using "Deploy to Bluemix" but simply using the deploy stage?
---
declared-services:
tuck-cloudant-cloudantNoSQLDB:
label: cloudantNoSQLDB
plan: Shared
applications:
- services:
- tuck-cloudant-cloudantNoSQLDB
- name: HelloWorldTuck4
path: HelloWorld.war
Thanks!
Jeff
The service bindings in the file manifest.yml are IBM extensions to the Cloud Foundry standard (see the Deploy to Bluemix) which are hopefully incorporated. However, at this time only the special deployment processing of the Deploy to Bluemix button will take care of that declared services section and will provision the services for you.
Indeed you can script the service creation in the pipeline.
There is even a way to make it occur with a Deploy to Bluemix button, using a pipeline.yml file in your sample repo: https://console.ng.bluemix.net/docs/develop/sharetextpipelines.html
See an example there:
https://github.com/hmagph/sample-java-cloudant
The declared services are specific to Deploy to Bluemix. You can, however, run pretty much any cf cli command you want in the deploy stage. You should be able to do a cf create-service ... or a cf bind-service .... This would have to be done manually, adding lines to the deploy script.