I have two parts with “plugin: python”, and it seems that they have some common python build-in files . How can I handle the conflicts ? Thank you .
reference:
https://insights.ubuntu.com/2017/01/28/ubuntu-core-how-to-enable-aliases-for-your-snaps-commands/
snapcraft.yaml file content is below :
name: aliyun
version: '1.0.0'
summary: aliyun is the Aliyun client tools for Linux.
description: |
osscmd is a commandline tool for aliyun oss.
ossutil is aliyun oss utility.
duplicity is a full/incremental backup tool with aliyun oss interface.
grade: stable #stable #devel
confinement: devmode
apps:
duplicity:
command: bin/duplicity
aliases: [ossduplicity, oss-duplicity]
ossutil:
command: bin/ossutil
aliases: [ossutil, oss-util]
osscmd:
command: bin/osscmd
aliases: [osscmd, oss-cmd]
parts:
duplicity:
plugin: python
python-version: python2
stage-packages:
- librsync-dev
- python-lockfile
- python-crcmod
- python-requests
python-packages:
- oss2
install: |
echo "++++++++++++++++++++++++++++++++++++++++ duplicity"
mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
cp aliyunsource/bin/duplicity $SNAPCRAFT_PART_INSTALL/bin/duplicity
cp -r aliyunsource/duplicity $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/
echo "---------------------------------------- duplicity"
ossutil:
plugin: nil
install: |
echo "++++++++++++++++++++++++++++++++++++++++ ossutil"
mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
cp aliyunsource/bin/ossutil $SNAPCRAFT_PART_INSTALL/bin/ossutil
echo "---------------------------------------- ossutil"
osscmd:
plugin: python
python-version: python2
build: |
echo "++++++++++++++++++++++++++++++++++++++++ osscmd"
mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
cp aliyunsource/bin/osscmd $SNAPCRAFT_PART_INSTALL/bin/osscmd
cp -r aliyunsource/oss $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/
echo "---------------------------------------- osscmd"
Hi, I have fill in the aliases field in the snapcraft.yaml file, but I cannot see the alises, and the “snap aliases” return empty. Please help me , thank you .
name: aliyun
version: '1.0.0'
summary: aliyun is the Aliyun client tools for Linux.
description: |
osscmd is a commandline tool for aliyun oss.
ossutil is aliyun oss utility.
duplicity is a full/incremental backup tool with aliyun oss interface.
grade: stable #stable #devel
confinement: devmode
apps:
duplicity:
command: bin/duplicity
aliases: [duplicity]
ossutil:
command: bin/ossutil
aliases: [ossutil]
osscmd:
command: bin/osscmd
aliases: [osscmd]
parts:
python-part: #duplicity, osscmd
plugin: python
python-version: python2
stage-packages:
- librsync-dev
- python-lockfile
- python-crcmod
- python-requests
python-packages:
- oss2
install: |
echo "+++++++++++++++++++++++++ python-part ossmd/duplicity"
mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
cp aliyunsource/bin/duplicity $SNAPCRAFT_PART_INSTALL/bin/duplicity
cp -r aliyunsource/duplicity $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/
cp aliyunsource/bin/osscmd $SNAPCRAFT_PART_INSTALL/bin/osscmd
cp -r aliyunsource/oss $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/
echo "------------------------- python-part ossmd/duplicity"
ossutil:
plugin: nil
install: |
echo "+++++++++++++++++++++++++ ossutil"
mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
cp aliyunsource/bin/ossutil $SNAPCRAFT_PART_INSTALL/bin/ossutil
echo "------------------------- ossutil"
ogra
July 31, 2017, 9:12am
44
As the article says you need to use “snap alias …” after installation (like you need to use “snap connect …” to make interfaces available to your snap)
I want to register the snap name “aliyun” in the Store , but failed. Who registered it ? If it’s me , I can push the snap successfully , is that right ?
snap alias failed ! What else should I do then?
snapcraft.yaml file content :
apps:
ossduplicity:
command: bin/ossduplicity
aliases: [ossduplicity]
ossutil:
command: bin/ossutil
aliases: [ossutil]
osscmd:
command: bin/osscmd
aliases: [osscmd]
ogra
July 31, 2017, 10:18am
47
i think you need to use the existing command name:
snap alias alicloud.ossutil ossutil
for details see:
Hi,
This blog post (https://insights.ubuntu.com/2017/01/28/ubuntu-core-how-to-enable-aliases-for-your-snaps-commands/ ) states that one needs to add aliases: to snapcraft.yml to be able to use aliases but in the example below postgresql93.pgdump command does not have an associated aliases: entity at all and yet it works:
$ sudo snap install --force-dangerous postgresql93_9.3.17_amd64.snap
postgresql93 9.3.17 installed
$ snap aliases
Command Alias Notes
$ snap alias postgresql93.pgdump blah
Ad…
Same install command , but different result in two machines . You can see the picture. I do not kown the reason.
ogra
July 31, 2017, 11:21am
49
Start by checking “snap version” on both systems…
ogra
July 31, 2017, 11:28am
51
The kernel of the second install is massively outdated (4.4 should be at -83-generic or newer) and likely full of security issues, try updating it.
That said, this should not result in a “not found” error… Is the network connection of the second install properly working ?
I have installed it in 3 machines, but only mine is OK… the others are “not found”.
ogra
July 31, 2017, 11:43am
53
are all of them having working network, are all of them amd64 based etc etc … try to find the difference between them …
i just noticed that you seem to be using a non-public store … indeed the machines need to know about this store (using snap find over here also does not return any results for alicloud)
I will find out the root cause, you can install it in your machines… Thank you .
I find that only my machine which snapcraft build the alicloud snap can install it successfully.
ogra
July 31, 2017, 11:59am
56
that and the fact that you do not upload to the main store but to a private one called “LimeNET” … (i have not much clue about private stores, you need to contact some store person)
Which Store is the main Store ? And how to switch it to the main Store ?
ogra
July 31, 2017, 12:05pm
58
i dont know, but apparently your install uses a store branded as “LimeNET”, you should talk to the store people that helped you setting this up …
I don’t know how to talk to the store people … Please help me .
ogra
July 31, 2017, 12:30pm
60
looks like it is now available in the public store:
ogra@styx:~$ snap info alicloud
name: alicloud
summary: "alicloud is the Aliyun client tools for Linux."
publisher: aliyun
description: |
osscmd is a commandline tool for Aliyun oss.
ossutil is Aliyun oss utility.
duplicity is a full/incremental backup tool with Aliyun oss interface.
channels:
stable: –
candidate: –
beta: 1.0.0 (1) 16MB devmode
edge: 1.0.0 (1) 16MB devmode
ogra@styx:~$
Yes, I change it to PUBLIC… and then it works .
I want to register “aliyun” as my snap name , but it has been registered already… What a pity ! Do you have any other good way ? “aliyun” should be mine…
It seems that “aliyun” has no snap info. …Why?
How can I get back my “aliyun” snap name ?