How to fix with custom image from slurm-gcp? - google-cloud-platform

I distributed slurm-gcp using Terraform through the GitHub and it was available successfully. Source:
Slurm on Google Cloud Platform
But I want to change the image I use when using node to a custom image.
I am trying to edit /slurm/scripts/config.yaml.
Among the contents of the file:
image: projects/schedmd-slurm-public/global/images/family/schedmd-slurm-20-11-7-hpc-centos-7
I want to edit the part.
How to reroute this part to my custom image?

First you need to create your own image.
Create a new VM with the image you want to modify; make appropriate changes and stop the VM. Then create a new image from the VM's disk.
Next create a custom image from that disk and your path in the config.yaml file can look like this:
image: projects/my-project-name/global/images/your-image-name
You can get exact path to your custom image by running:
wb#cloudshell:~ (wb)$ gcloud compute images describe your-image-name | grep selfLink
selfLink: https://www.googleapis.com/compute/v1/projects/wb/global/images/your-image-name

Related

Google Artifacts vulnerability report - On demand image scanning

I have scenario where I am using GCP an on-demand image scanning using gcloud - like:
gcloud artifacts docker images scan europe-west2-docker.pkg.dev/ORG_NAME/myrepo/python_script#sha256:4e3dd2d724ded3cc434ec9fdc33bdfdab1c0d579430b64c9baf4ecb901115b05 --remote --location=europe
And its working fine and I can retrieve the vulnerability scan report using:
gcloud artifacts docker images list-vulnerabilities projects/ORG_NAME/locations/europe/scans/661e3c2a-c27c-6617-9088-80c7d40e14b8
Now the problem that this report doesn't appear on the artifacts dashboard like it does for auto scanning.
Auto Scanned Image:
Auto Scanned Image - Vulnerability Scan report
Any idea how can I make this on demand scanning report to show on artifacts dashboard for the particular image.
I have tried to look for storing artifacts metadata: https://cloud.google.com/container-analysis/docs/metadata-storage - but I can't find a way to store the data and make it appear on the artifacts dashboard.
The artifacts dashboard only provides data for containers that were scanned automatically. Gcloud is the preferred way to retrieve vulnerability data from On Demand Scanning.

Cannot create GCP VM, public images are empty

When attempting to create a new GCP VM on a new account, the list of public images is empty. If I try to launch an image from the public marketplace, the boot device will not be attached.
What am I doing wrong here?
Turns out the problem was caused by the security group in my organization which set a public image constraint and neglected to ensure my team was aware of it.
https://cloud.google.com/compute/docs/images/restricting-image-access
open cloud shell as per my comment (right upper corner square with ">" sign)
list images using
gcloud compute images list
Output will look like this:
try to create your VM with desired image via opened cloud shell using for example the following
gcloud compute instances create test --image-family ubuntu-1804-lts --image-project ubuntu-os-cloud
Output should look something like this:
If so, you will find your instance running under compute engine.
PS.
Dont forget to turn these VMs off when you are done.
If you want to select another image make sure to use image project and image family from output from step 2.
Either way at least this should give you some errors to resolve

How to provide image name in gcp terraform script?

I'm trying to learn terraform, how do i change image name in the terraform script?
For example, in the below script the default linux image given is debian-cloud/debian-9, how to change the image, say something from marketplace https://console.cloud.google.com/marketplace/details/click-to-deploy-images/deeplearning?q=deep%20learning%20vm&id=8857b4a3-f60f-40b2-9b32-22b4428fd256
gcp terraform link - https://www.terraform.io/docs/providers/google/r/compute_instance_template.html
if you are looking for standard images available from GCP run following command and grep the type of image.
gcloud compute images list | grep ubuntu
it will list something like following. First column is NAME second is PROJECT and third is FAMILY. In script you can mention the Project/Family (ubuntu-os-cloud/ubuntu-1804-lts)
ubuntu-1604-xenial-v20210329a ubuntu-os-cloud ubuntu-1604-lts
ubuntu-1804-bionic-v20210325 ubuntu-os-cloud ubuntu-1804-lts
As you want to deploy the image, it seems the framework is TensorFlow Enterprise 2.1 (CUDA 10.1).
As the documentation, we have listed the most recent versions of image families, organized by framework type. Creating an instance by referencing an image family with the “latest” in the name ensures that you always get the most recent version of that image. So from the documentation, we could have the image name as required.
I hope documentation and this other one also informative for you.
Here you are referring to a marketplace image.
You can change it in the main.tf
initialize_params {
image = "debian-cloud/debian-9"
You can list images using #gcloud compute images list redhat
It will list all the image references to redhat releases.

AWS CodeBuild - Environment based off of image from docker hub

Quick question and this may be a dumb one. I am attempting to use AWS Code Build with an image I've published to Docker Hub. I selected the option to use a custom image, and the the option to look for the image in another location (an external image repo).
I can't seem to figure out how to reference my image in the appropriate format to use it in the other location field.
Any help would be greatly appreciated.
In the "Other location" text box you can enter the image name from DockerHub. For example, simply give "openjdk" or "openjdk:latest" to use https://hub.docker.com/r/library/openjdk/ as the Docker image for your build. Don't put the "docker pull " prefix for your image name is all.
Note that CodeBuild only supports public Docker images from DockerHub today. Private registries are not supported.
Lets say that you published your image in hub.docker.com, and your repo name is gjackson/myrepo, and you want to grab the image tagged latest, you should populate the other location field with docker.io/gjackson/myrep:latest.

How to change image family for existing image in google cloud compute?

It looks that unlike labels, image family cannot be changed after the creation of the image. It is so?
You have to create a new image from the existing one using gcloud with --source-image
gcloud compute images create ${PROD_IMAGE} --family=${PROD_FAMILY} \
--source-image=${DEV_IMAGE} \
--source-image-project=${GCP_PROJECT} --project=${GCP_PROJECT}
You can only update the cloud labels for an existing image.