Unable to run cdk commands on my windows having python installed - aws-cdk

Installed aws-cdk using pip on windows10. After restart, when i run cdk --version on cmd prompt, it says 'cdk' is not recognized as an internal or external command,
operable program or batch file.
aws --version
aws-cli/2.0.30 Python/3.7.7 Windows/10 botocore/2.0.0dev34
python --version
Python 3.8.1
Do I need to install NodeJS as well?
Please help me setup cdk on my windows10 laptop....

Based on the official documentation you need to have Node.js installed.
And I'll quote from the documentation
All CDK developers need to install Node.js 10.3.0 or later, even those working in languages other than TypeScript or JavaScript.
Also..
Install the AWS CDK Toolkit globally using the following Node Package Manager command.
npm install -g aws-cdk
After that you should be able to run cdk --version without any issues

Related

Playwright on Azure Functions Python based

I am trying to scrape a website using playwright and host it on Azure Functions. However, playwright requires Chrome drivers which I can't seem to install into Azure Functions.
Unsure how to do this step in a pipeline:
pip install playwright
playwright install
Previously, I tried to do it in an azure pipeline:
- script: |
python -m venv ./azfunc/.python_packages
source ./azfunc/.python_packages/bin/activate
python -m pip install --upgrade pip keyring artifacts-keyring
pip install -r ./azfunc/requirements.txt
python -m playwright install
displayName: 'Install dependencies'
However, I get a webkit" browser was not found.Please complete Playwright installation via running"python -m playwright install
It seems like the Azure Function is not finding where it was installed. Any suggestions? Would using Docker be a good tactic?
Looks like azure functions support headless chromium with consumption based app service plan.
Here is the blog to know more about the running headless chromium in azure functions with playwright
over this github issue ,it was suggested to use the azure functions on docker container
please file a support ticket and MS Q&A here

Cannot uninstall Docker Desktop via Chocolatey

I've installed Docker 2.4 quite some time ago using Chocolatey (my OS is Win 10). Since updating Docker using choco upgrade all always failed, I did the updates manually via the Docker itself (right-click → Check for Updates → etc.). Now I'm on version 3.2.
Since I want to get rid of this manual update process, I wanted to uninstall Docker from Chocolatey. But executing choco uninstall docker-desktop fails with ERROR: Exception calling "GetFullPath" with "1" argument(s): "Illegal characters in path.".
Of course, I could uninstall Docker the usual Windows way. But how would I remove Docker from Chocolatey so that I can do a fresh install?
I was able to solve the issue by manually uninstalling Docker with default Windows tools.
Afterwards, I deleted the folder C:\ProgramData\chocolatey\lib\docker-desktop. This resulted in a clean environment when it comes to Docker, because Chocolatey seems to maintain all package-related things in the corresponding C:\ProgramData\chocolatey\lib\<<package>> folder.
Finally, I could install Docker again via choco install docker-desktop.

Cannot perform an interactive login from a non TTY device

I was working with docker build that was working fine for me but from yesterday i am getting error while trying to login to aws cli docker
Error Error: Cannot perform an interactive login from a non TTY device
I was facing the same issue. I was using the AWSCli v1 and once I upgraded to v2, it worked fine!
Here is a page that might help.
In my case I not only needed to install AWS CLI v2 but I also needed to uninstall AWS CLI v1. Per the documentation here that is what is recommended.
"AWS CLI versions 1 and 2 use the same aws command name. If you have both versions installed, your computer uses the first one found in your search path. If you previously installed AWS CLI version 1, we recommend that you do one of the following to use AWS CLI version 2:
Recommended – Uninstall AWS CLI version 1 and use only AWS CLI version 2. For uninstall instructions, determine the method you used to install AWS CLI version 1 and follow the appropriate uninstall instructions for your operating system in Installing, updating, and uninstalling the AWS CLI version 1."

How to install apt in Docker machine?

I'm SSH'd into a Docker VM (the default machine) and did a apt-get update and this is what I got:
I'm not a huge Linux user; how do I install apt in a Docker machine? I'm ultimately wanting to install vim and/or nano via apt-install on the machine.
Working with TinyCore distribution and installing apt is not a good selection. instead you could use lubuntu
TinyCore Dist comes with tce-load package. Which you can use to download the packages. example:
tce-load -wi vim.tcz or tce-load -wi nano.tcz
ASR has the correct answer. I just wanted to include some things in case others read this post.
A list of available packages for Tiny Core Linux (TCL) is here (note, I have TCL version 8.2.1 installed and this list of showing for TCL version 10.x, but I think the package names stay the same for the most part):
http://distro.ibiblio.org/tinycorelinux/10.x/x86/tcz/
And a TCL cheat sheet for installing packages is here:
http://wiki.tinycorelinux.net/wiki:package_management_cheat_sheet
End result: =)
As there are no package managers apt, yum, apk inside docker machine, my case docker toolbox on Windows, and windows does not dispone with Linux package managers unless using cygwin or other workaround, I used Windows 10 Pro Ubuntu subsystem, where it is possible to use apt.

How to install new software onto a GCP flexible environment VM

I have a ruby on rails app running on a Google Cloud Platform VM running on the app engine flexible environment. It looks like it installs most of the software on the VM when I deploy the app with gcloud --project project-name preview app deploy I think it installs rails and other software from reading the temporary dockerfile it creates. It grabs the info for the dockerfile from the app.yaml file (I got this setup from following their tutorials).
This was working fine for me but now I need to install ImageMagick onto the server to manipulate images on the site. Normally you do this by running sudo apt-get install imagemagick from the project directory. When I SSH onto the VM I cant find the project directory so that doesn't work.
I have no idea how to get it to run sudo apt-get install imagemagick each time I make a new deploy to the site so it has the software on the new VM.
As you might be able to tell I'm not very good with the server side of things and want to know what I'm supposed to do to get new software onto the VM the right way so its always there like ruby and rails etc.. are each time I make a new deploy.
You should use a custom Dockerfile when you need additional configuration.
To install ImageMagics you have to set runtime: custom in your app.yaml, create a Dockerfile based on default one, and add following line:
RUN apt-get update && \
apt-get install imagemagick -y

Resources