Why is the gcloud sdk's deploy command looking at my home directory for files? - gcloud

I'm attempting to deploy a python server to Google App Engine.
I'm trying to use the gcloud sdk to do so.
It appears the command I need to use is gcloud app deploy.
I get the following error:
me#mymachine:~/development/some-app/backend$ gcloud app deploy
ERROR: (gcloud.app.deploy) Error Response: [3] The directory [~/.config/google-chrome/Default/Cache] has too many files (greater than 1000).
I had to add ~/.config to my .gcloudignore to get past this error.
Why was it looking there at all?
The full repo of my project is public but I believe I've included the relevant portion.

I looked at your linked repo and there aren't any yaml files. As far as I know, a GAE project needs an app.yaml file because that file tells GAE what your runtime is so that GAE knows how to deploy/run your code. In fact, according to the gcloud app deploy documentation, if you don't specify any yaml files to be deployed, it will default to app.yaml in the current directory. If it can't find any in the current directory, it will try to build one.
Your repo also shows you have a Dockerfile. GAE documentation for custom runtimes says ...Custom runtimes let you build apps that run in an environment defined by a Dockerfile... In the app.yaml file for custom runtimes, you will have the following entry
runtime: custom
env: flex
Since you don't have an app.yaml file and you have a Docker file in which you are downloading and installing Chrome, it seems to me that gcloud app deploy is trying to infer your runtime and this has led to it executing some or all of the contents of the Dockerfile before it attempts to then push it to Production. This is what is making it take a peek at the config file on your local machine till you explicitly tell it to ignore it. To be clear, I'm not 100% sure of this, just trying to see if I can draw a logical conclusion.
My suggestion would be to create an app.yaml file and specify a custom runtime. Or just use the python runtime with flex

Related

Vercel is changing the contents of js file on deployment

I am trying to deploy a mern app on vervel using the vercel serverless functions. The idea is that the backend will be used for serving the file present inside build folder in frontend. But, after deployment, I am constantly getting the the error:
Going to the sources, we can see the line which is causing the error:
Now, when I check the same file in my build folder, I see that there are no such lines present in the code. In fact, the code in that file in my build folder starts from line 8 of above image.
This means vercel has added the few initial lines by itself, which caused the error.
Why has it done that? And what is the solution for that?

App Service deploy of NODE JS app fails with web.config error

I am deploying a NODE JS app to an Azure App Service using Azure Devops pipelines, but it failes with the following error
##[error]Error: Failed to generate web.config. Error: ENOENT: no such file or directory, open 'D:\a\_temp\temp_web_package_09902550774824137\web.config'
But in my deploy step I have the generate web.config step so I am not sure why its not working?
Thanks for asking question! You may try below steps for troubleshooting the issue.
Check that the application is listening on the port provided by the PORT environment variable: process.env.PORT. You may use the WEBSITES_PORT app setting set to port.
Also,review the web.config and make sure the name of the main script file in the handlers section matches the main script file and the Web.config configuration for settings names/values.
Check that the nodeProcessCommandLine setting to ensure that the Node.exe is available at the correction location.
Also, In order for Kudu to detect a Node.js app, you need a package.json file and an app.js/index.js in the root of your folder. It's recommended to correctly set the start script in the package.json file https://docs.npmjs.com/misc/scripts#default-values
If the deployment steps run correctly, however, the app fails to start due to a missing npm package, note that only "dependencies" are installed, "devDependencies" are not installed by default.Try viewing the logs to fetch more details.

Packaging SF service into a single file

I am working through how to automate the build and deploy of my Service Fabric app. Currently I'm working on the package step and while it is creating files within the pkg subfolder it is always creating a folder hierarchy of files, not a true package in a single file. I would swear I've seem a .SFPKG file (or something similarly named) that has everything in one file (a zip maybe?). Is there some way to to create such a file with msbuild?
Here's the command line I'm using currently:
msbuild myservice.sfproj "/p:Configuration=Dev;Platform=AnyCPU" /t:Package /consoleloggerparameters:verbosity=minimal /maxcpucount
I'm concerned about not having a single file because it seems inefficient in sending a new package up to my clusters, and it's harder for me to manage a bunch of files on a build automation server.
I believe you read about the .sfpkg at
https://azure.microsoft.com/documentation/articles/service-fabric-get-started-with-a-local-cluster
Note that internally we do not yet support provisioning a .sfpkg file. This is a feature that will be coming in soon (date TBD). Instead, we upload each file in the application package.
Update (SF 6.1 - April 2018)
Since 6.1 it is possible to create a ZIP file (*.sfpkg) and upload it to an external store. Service Fabric executes a GET operation to download the sfpkg application package. For more infos see https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-package-apps#create-an-sfpkg
NOTE: This only works with external provisioning, the Azure image store still doesn't support sfpkg files.

Installing Grafana Panel Plugin

I am attempting to install the piechart plugin on my Grafana v2.5 environment and no matter what I do the panel does now show as an option in the UI. I cloned the repository to /var/lib/grafana/plugins as documented and restarted the grafana-server service and that did not work. I also tried putting the plugin in a separate directory and referencing it as:
[plugin.piechart]
path = /home/usr/share/grafana/panel-plugin-piechart
I made sure that the grafana service has ownership of the plugin directory, and checked the grafana logs but it did not have useful information.
https://github.com/grafana/panel-plugin-piechart
You will need Grafana master based on the release date of the plugin.
Confirmed here - https://groups.io/g/grafana/message/1181
You definitely need to upgrade your Grafana. This is very seamless operation - just install a new package on top of the old one. You can back up through copy /var/lib/grafana/grafana.db for safety before doing that.
Check the permission of the files in plugins directory,
all the files of the plugin should be in its directory, i.e. every plugin should be contained its own directory
if the plugins directory has any package.json file or webpack.config.js available outside then also your plugins will fail to load.
the above mentioned files are part of every panel plugins and should only exist in their respective directories.
execute "chown" and set the owner to grafana:grafana group:user
(by default root is the owner of the files and directories.)
Are you running Grafana as a standalone service or in a docker container?
If running as a service directly you can visit the Grafana community page and find the plugin installation instructions from there.
https://grafana.com/grafana/plugins/grafana-piechart-panel
(Verified on Grafana version 6.x.x & 7)
If running within a dockerized service you need to copy the plugin in your workspace and specify the directory within the docker image so it can locate the plugin from there. You can do this by using the environment variables and mention these within a docker-compose file
GF_PATHS_PLUGINS /var/lib/grafana/plugins
https://grafana.com/docs/grafana/latest/installation/configure-docker/
I have been able to work with both these options

TFS Build Website deployment package web.config transformation not working

So I am trying to use TFS Build for generating deployment packages for my 3 environments (ST, UAT, Prod).
This what I followed to successfully genrate the package locally.
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/74bb16ab-5fe6-4c00-951b-666afd639864/
So my local machine will generate the package for the acyive configuration and everything is good. Here is my Build definition :
/p:DeployOnBuild=true;DeployTarget=Package
I run my solution file and the web deployment project in the Projects To Build.
It creates the respective folders with ST, UAT and PROD. In each of these there is a _PublishedWebsites folder. This folder have 2 folders.
1) MydeploymentProject - It contains the transformed web.config
2) MyDeploymentProject_Package - Contains the Package folder contents along with the zip file and setparameters files. Here the everything is not transformed. But if I check the TempBuildDir on the TFS server it does contain the transformed config.
When compared the logs local and on server, I found that the on my local After transformation files are updated and package is created whereas on TFS the AfterBuild target is called transformation done and it ends there.
this is my local log
Target "WPPCopyWebApplicaitonPipelineCircularDependencyError" skipped, due to false condition; ($(WPPCopyWebApplicaitonPipelineCircularDependencyError)) was evaluated as (False).
Target "ProcessItemToExcludeFromDeployment" in file "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" from project "C:\TAX-IT\Main\Source\TDDB\TDDB_deploy2\TDDB_deploy2.wdproj" (target "PipelineCollectFilesPhase" depends on it):
Done building target "ProcessItemToExcludeFromDeployment" in project "TDDB_deploy2.wdproj".
Target "GetProjectWebProperties" in file "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" from project "C:\TAX-IT\Main\Source\TDDB\TDDB_deploy2\TDDB_deploy2.wdproj" (target "PipelineCollectFilesPhase" depends on it):
Using "GetProjectProperties" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v10.0\....\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll".
Task "GetProjectProperties"
I am not sure what is wrong.
Also I installed VS2010, web deploy 2.0 and 3.0 and web deployment tools on my Build servers.
Anyone have faced this and resolved.
Please help.
Thanks
MadCoder,
From what I've gathered from your description, you have everything set up correctly. It seems like you are just missing the "Configuration" parameter. When you do run the Build Definition, it uses the configuration specified in your "Configurations to Build" argument. If you want to have multiple configurations built (like you are suggesting), you'll need to have multiple configurations defined. One question I have is: When you look at the logs of the TFS Build Process, do you see multiple configurations built, or do you only see one? If you only see one, then you don't have all of the configurations defined in order to transform the config file. According to your description, you'll need to see something like this in your build definition configuration:
If you don't want to deploy to a webserver, you can stop reading here, and don't have to continue on.
If you choose to use a TFS Build Definition to deploy to a web server, you'll need to have a target web server somewhere and you'll need to install and configure the Web Deploy v2/v3 on that server as well.
When you are using TFS Build Definitions to deploy, the transformation happens upon deployment, not during packaging (prior to deployment). It may package up a transformed config somewhere, but it won't actually transform the config bundled with the website. The only way I've been able to get the deployment to actually work with a transformed config is when I had a website specified in the MSBUILD args. Here is an example of my MSBUILD args:
/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=MyWebServer/MsDeployAgentService /p:DeployIisAppPath="MyWebsite as named in IIS" /p:UserName=MyDomain\MyWebDeployUser /p:Password=MyWebDeployPassword
If you don't want MSBUILD to do the actual deployment (I prefer not to because then your deployment process is tied to TFS), you can do the deployment after the build process and use the CTT Project, found on codeplex. This tool performs the exact same transformations as MSBUILD, but it also includes the ability to parameterize settings so you can define classes of environments (for example, 3 QA environments, 2 Staging Environments, etc.) and still use the respective transforms for that class of environment.