How to rename a docker image from MiroK8S? - microk8s

I have imported a TAR file to a MicroK8S setup using this command :
microk8s ctr images import my-service.tar
After import, the image has an other name like : import-2021-09-08:1.0.1
Any idea on how to import to an other name or how to change the name after import ?
P.S. : The original name was : my-service:1.0.0
Thanks in advance.

I have found the solution on the import command :
microk8s ctr images import --base-name my-service my-service.tar

Related

Cannot import package "google.golang.org/api/compute/v1"

I am using cloud function to auto create some VM instance. Before, I was success in my use-case. You can view it here.Now, I want to update some line in metadata script. But when I save the code, it tell me some package I was import cannot find. Logs is
Build failed: src/cloudfunctions/function.go:9:2: cannot find package "google.golang.org/api/compute/v1" in any of:
/usr/local/go/src/google.golang.org/api/compute/v1 (from $GOROOT)
/workspace/src/google.golang.org/api/compute/v1 (from $GOPATH); Error ID: 2f5e35a0
But I was view document in https://pkg.go.dev/google.golang.org/api/compute/v1, usage example import like this import "google.golang.org/api/compute/v1", as same as me.
So, who can tell me what is $GOROOT and $GOPATH in cloud function, and how can I import this package.
Thanks in advance.
Run
go get -u -x google.golang.org/api/compute/v1
Then cd/open your directory in terminal then run
go mod init filename.go
then
go mod tidy
Also restart your IDE as that will need to update

Broken DAG: [link] cannot import name 'FileSensor'

I'm getting this error on the airflow UI. the code line I've entered is:
from airflow.contrib.sensors.file_sensor import FileSensor
any ideas?
found nothing on google.
thanks
Are you using an Airflow version < 1.10, e.g. 1.9?
In that case, try the following:
from airflow.contrib.operators.fs_operator import FileSensor
I tried this in v1.10.9 and the following both work.
from airflow.contrib.sensors.file_sensor import FileSensor
from airflow.contrib.operators.fs_operator import FileSensor
See the following links for reference:
https://github.com/apache/airflow/blob/v1-9-stable/airflow/contrib/operators/fs_operator.py
https://github.com/apache/airflow/blob/v1-9-stable/airflow/contrib/operators/init.py

How to fix ModuleNotFoundError: No module named 'pyjokes'

I have installed pyjokes with pip3!
sudo pip3 install pyjokes
And have it in the terminal when i do pip3 list below picture!
And i have my simple file down below here!
import pyjokes
joke = pyjokes.get_joke('english','neutral')
print(joke)
But i get this error when i run the file pic below]2
How can i fix this error?
I searched on my own and saw this helped me
You import sys to your file and use sys.path.append() for adding the file name to your file it worked strange with pyjokes.get_joke() though?
import sys
sys.path.append('/usr/local/lib/python3.7/dist-packages/')
import pyjokes
print(pyjokes.get_joke())
Replace this:
[joke = pyjokes.get_joke('english','neutral')]
With this:
[joke = pyjoke.get_joke('en','neutral')]

Not finding import image file

I tried to import bulk image dataflow profile,
this is my export format:
this is my import format :
this is my excel format in which I export,
then I import the exported excel file and get the following error:
Step1: Create import folder inside media folder
Step2: manage you csv file , Only add "/imagename.jpg" in your images
columns

Q: Getting Build Error "Invalid Import Path"

I'm stuck on running the BeeGO app using "bee run" it says
The thing is I've already have setup properly my GOPATH to D:/Web Dev/GO/BeeGO/test-project/
and also routers path does exist and I've tried to manual build the file but it doesn't generate an .exe file.
Anyone knows how to fix this?
I'm using Windows 8.1 Pro (64-bit)
Thanks
GO expects the directory structure under $GOPATH in following ways as described in code organization:
$GOPATH/src <--- where your source code goes
/pkg
/bin
Instead of placing your source files directly under $GOPATH (D:/Web Dev/GO/BeeGO/test-project/ for your case), you want to move your code under $GOPATH/src.
D:/Web Dev/GO/BeeGO/test-project/src/main.go
D:/Web Dev/GO/BeeGO/test-project/src/quickstart/routers/routers.go
D:/Web Dev/GO/BeeGO/test-project/src/quickstart/controllers/controllers.go
import path should be always starting from $GOPATH/src. routers.go can be always imported as import "quickstart/routers" and controllers.go can be imported as import "quickstart/controllers".
That's not how you import a package.
The import path is relative to $GOPATH/src. use:
import "quickstart/routers"
Finally fixed the bug from the framework,
What I did:
in main.go import from
"D:/Web Dev/GO/BeeGO/test-project/quickstart/routers"
I changed it to _"../quickstart/routers" make sure to include _ this means to import the library even if it is not used,
Then in the routers/router.go I changed the import path
"D:/Web Dev/GO/BeeGO/test-project/quickstart/controllers" to "../controllers"
It seems BeeGO doesn't generate the template properly and caused the build to fail.
Another possiblity for this error, is when you copy-paste code from the internet,
and
import "quickstart/routers"
became
import "quickstart/routers "
due to bugs in some CMS/Blog systems (notice the space at the end before the closing quote...).

Resources