aristanetworks / EosSdk

EOS SDK - write native apps for your Arista switch
https://github.com/aristanetworks/EosSdk/wiki
BSD 3-Clause "New" or "Revised" License
156 stars 40 forks source link

Can't download debs #24

Closed ghost closed 7 years ago

ghost commented 7 years ago

This Wiki page https://github.com/aristanetworks/EosSdk/wiki/Build-and-Development-Environment has download links: ftp://ftp.arista.com/data/ar/crossgcc/arista-fc14.deb ftp://ftp.arista.com/data/ar/crossgcc/arista-fc14-gcc4-9.deb

Unfortunately, when I access them, I get a "550 Failed to open file" error. Are these debs available from another location?

thanks, Paul

ruferp commented 7 years ago

Sorry, the ftp server gets cleanup from time to time... I just put the files back right now, and added one called fc18.tar.gz, since from EOS release 4.17.0 on EOS is Fedora18 based. Unfortunately that last one is not a Debian package, but it untars into the same location (/opt/arista/fc18/).

ghost commented 7 years ago

Awesome, and thanks for the quick response!

ruferp commented 7 years ago

Also, when trying your application on EOS release >= 4.16, you need to create a "mount profile" for your application. The content of that profile depends on what "managers" your application is using. Here is the brute-force recipe for mounting everything (you can cut down the mounts for efficiency later by trimming lines from this brute-force profile):

Enter bash mode from the EOS cli, then copy/paste the below, after changing the first line to match your application's executable (previously scp-ed to /mnt/flash or /usr/bin)

bin=/usr/bin/myApp # <<<=== adapt this line name=$(basename $bin) dest=/usr/lib/SysdbMountProfiles/$name source="/usr/lib/SysdbMountProfiles/EosSdkAll" cat $source | sed "1s/agentName[ ]:./agentName:${name}-%sliceId/" > /tmp/tmp$name delta=$(cmp /tmp/tmp$name $source) if [ "$?" = "0" ]; then echo "Error: something is wrong" else sudo mv /tmp/tmp_$name $dest fi

The mount profile will be /usr/lib/SysdbMountProfiles/myApp

You will need to re-install that file to /usr/libSysdbMountProfiles after a reboot. This can be done via a "on-boot" script, or by packaging that profile into an RPM and configure EOS to boot with it (that's the best route if your application is already installed via an RPM).

The on-boot script route looks like this:

switch(config)# event-handler switch(config-handler)# trigger on-boot switch(config-handler)# action bash /mnt/flash/.sh

where /mnt/flash/.sh is a script that copies (installs) the profile from /mnt/flash to /usr/lib/SysdbMountProfiles.

The RPM route looks like this (after scp-ing the RPM to /tmp on the switch):

switch(config)# copy file:/tmp/myApp.i686.rpm extension: switch(config)# extension myApp.i686.rpm switch(config)# copy installed-extensions boot-extensions

The second line installs the RPM, the third one makes sure it will get re-installed after a reboot.

ghost commented 7 years ago

Hi,

Can I use some other Linux distribution then Fedora 18 for building my application using this compiler fc18.tar.gz? I am trying it on CentOS 7 but I am getting this error: /opt/arista/fc18/lib/gcc/i686-pc-linux-gnu/4.9.2/../../../libstdc++.so: undefined reference to `__cxa_thread_atexit_impl@GLIBC_2.18'

The glibc version on my system is 2.17.

I also noticed that your compiler does not search in /usr/include and /usr/lib by default. I had to use "-idirafter /usr/include" compiler option and add extra linker option "-L/usr/lib" to workaround the problem.

I am able to compile my application and successfully run it on EOS using my own compiled gcc 4.9.2 though. I used following option to compile gcc: ./configure --enable-multilib --enable-languages=c,c++ Can I use this method instead to build my application for EOS? Are there any risks doing it this way? I rather avoid using Fedora 18 as my development machine as this OS reached EOL.

Thanks, Hubert

ruferp commented 7 years ago

In principle the fc18.tar.gz is for cross-compiling on Ubuntu. We have yet to compile a similar cross-compiler on CentOS (it is on our todo list). The compiler does not search in /usr/include because it is a cross-compiler. In fact, if you force it to find headers and libraries from the local machine, you might end up with errors like the one you got.

If you use your own gcc 4.9.2 compiler you will be fine. The more critical item is the version of libstdc++ since some EosSdk apis use std:: structures and the binary signature of those sometimes changes between libstdc++ versions. Gcc 4.9.2 comes with libstdc++.so.6.0.20, which is the one used on Eos >= 4.17. As for libc, as long as you compile against a libc version that's less than the one on Eos you are fine.

ghost commented 7 years ago

Thanks for the quick response. In fact your cross-compiler works well on CentOS. After I changed my build scripts to not use headers and libraries from my local machine and build all dependencies instead I was able to build my application and run it on EOS. Thanks.

ghost commented 7 years ago

Hi,

the FTP server got cleaned up again. There is no ftp://ftp.arista.com/data/ar/crossgcc/fc18.tar.gz . Can you put it back please?

Thanks, Hubert

ruferp commented 7 years ago

it is back now, sorry.

krzysztof-sprzaczkowski commented 7 years ago

Hi - Again we were lost an access to FTP server - I can not download crossgcc compiler now - ftp://ftp.arista.com/data/ar/crossgcc/fc18.tar.gz. Could you please restore all packages which were under this location?

Thanks Krzysztof

ruferp commented 7 years ago

The ftp server gets purged from time to time... I will try to push the next version to our regular software download site.

I put it back, and besides the tarball I also added a debian package, which is actually smaller is size (I removed some junk), to be installed like "sudo dpkg -i arista-fc18-gcc4-9-2.deb".

ftp://ftp.arista.com/data/ar/crossgcc/arista-fc14.deb (before release 4.17.0) ftp://ftp.arista.com/data/ar/crossgcc/fc18.tar.gz ftp://ftp.arista.com/data/ar/crossgcc/arista-fc18-gcc4-9-2.deb

ghost commented 7 years ago

Hi,

Can you please restore the tarball? This file: ftp://ftp.arista.com/data/ar/crossgcc/fc18.tar.gz I see the deb package is available on the software download page, but I can't use it becasue:

  1. I am using centOS as my development machine
  2. I have a script that automatically downloads the cross compiler from your FTP site and creates a docker container with centOS.

Thanks, Hubert

ruferp commented 7 years ago

I put it back for now, but like said previously, the ftp site is purged from time to time. What about we convert the .deb into a .rpm and add that to the Software Download Page (along side the .deb)?

ghost commented 7 years ago

Thanks for putting it back. This is a great idea to create rpm package too. Both .deb and .rpm packages should be available on the Software Download Page.

ghost commented 7 years ago

I wonder if we a should change the logic to use a local copy of the most recent version available via FTP. Try the FTP and if it fails, then use the previous version. This should work fine; it sounds like newer files are not deleted from Arista download site.

From: hubertsokolowskintl [mailto:notifications@github.com] Sent: Tuesday, September 19, 2017 4:35 AM To: aristanetworks/EosSdk EosSdk@noreply.github.com Cc: Von Behren, Paul paul.von.behren@intel.com; Author author@noreply.github.com Subject: Re: [aristanetworks/EosSdk] Can't download debs (#24)

Thanks for putting it back. This is a great idea to create rpm package too. Both .deb and .rpm packages should be available on the Software Download Page.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/aristanetworks/EosSdk/issues/24#issuecomment-330469304, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHr71_vdBSIxSgB66UWJ1dT72rOmk3aCks5sj3y5gaJpZM4NYS4G.

ruferp commented 7 years ago

I put an rpm version of the cross-compiler at: ftp://ftp.arista.com/data/ar/crossgcc/arista-fc18-gcc4.9.2.rpm let me know if it works for you, then we can put it up on the Software Download Page.

This is how I tested it (had to install 32 bit version of libz, but CentOS already came with everything else to run 32 bit executables, unlike Ubuntu).

wget http://mirrors.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso create/start VM, login ip addr <== get ip address (no copy/paste here, do everything from host ssh) on host cat xgcc_vars ip=172.16.248.233 username=prufer xgcc=arista-fc18-gcc4-9-2 xgcc_root=/opt/arista/fc18-gcc4.9.2 EosSdk_stubs=EosSdk-stubs-1.12.3 source ./xgcc_vars scp $xgcc.rpm $username@$ip:/home/$username scp $EosSdk_stubs.tar.gz $username@$ip:/home/$username scp xgcc_vars $username@$ip:/home/$username ssh $username@$ip source ./xgcc_vars sudo yum install -y zlib.i686 sudo rpm -i $xgcc.rpm tar -xzf $EosSdk_stubs.tar.gz cd $EosSdk_stubs PATH=$xgcc_root/bin:$PATH ./build.sh >& m; echo $? ls -l .libs/HelloWorld sudo make install

ghost commented 7 years ago

In fact it is 4.9.3: ...~]$ gcc --version gcc (GCC) 4.9.3 20141101 (prerelease) I see some paths have changed, i.e. was /opt/arista/fc18/lib/libssl3.so now is /opt/arista/fc18-gcc4.9.2/usr/lib/libssl3.so Was the compiler change intentional? The filename suggests it is same version as before.

ruferp commented 7 years ago

interesting, maybe 4.9.2 final just shows up as 4.9.3 prerelease In any case, the timestamp is the same (20141101), and this is the compiler we use, this is from our source tree:

tar -xf gcc-4.9.2-20141101.tar cd gcc-4.9.2-20141101 cat gcc/BASE-VER 4.9.3

and here we see where the 4.9.3 comes from

ruferp commented 7 years ago

yes, the path change was intentional, this makes it the same as in the .deb package. and in the next release it will be fc18-gcc5.4.0

ghost commented 7 years ago

OK, makes sense. Please put it on the Software Download page so people can download it in case it gets removed from FTP server. Thanks.

shrikanthmd1986 commented 6 years ago

Hello, I guess this is still not available on the software download page! Can you please upload?

ruferp commented 6 years ago

I see it here: https://www.arista.com/en/support/software-download

screen shot 2017-12-10 at 12 46 52 pm
shrikanthmd1986 commented 6 years ago

Hello,

I suppose it requires some sort of contractual binding to get full-access to software downloads. Please confirm. This is what I see from my login. Only the vEOS is available for download. [image: Inline image 1]

Regards, Shrikanth

On Sun, Dec 10, 2017 at 9:49 PM, ruferp notifications@github.com wrote:

I see it here: https://www.arista.com/en/support/software-download [image: screen shot 2017-12-10 at 12 46 52 pm] https://user-images.githubusercontent.com/8683589/33809232-75fb1988-dda8-11e7-96d1-2945a5da9be4.png

You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aristanetworks/EosSdk/issues/24#issuecomment-350580499, or mute the thread https://github.com/notifications/unsubscribe-auth/AEtBEMvVZwhNfYwH94whMu6meW8THyBwks5s_EPEgaJpZM4NYS4G .

arista-travisci commented 6 years ago

maybe the download page is username dependant, I don't know, you can contact the business side of arista for this, there are links and number on that page.

in the meantime, I copied them to the ftp server, but they will get purged again....

prufer:Downloads prufer$ ftp ftp.arista.com

Name (ftp.arista.com:prufer): anonymous

Password:

ftp> cd data/ar/crossgcc/

ftp> put arista-fc18-gcc4-9-2.deb

ftp> put arista-fc18-gcc4.9.2-1.0-0.i686.rpm

ftp> put arista-fc18-gcc5-4-0.deb

ftp> put arista-fc18-gcc5.4.0-1.0-0.i686.rpm

On Sun, Dec 10, 2017 at 11:07 PM, Shrikanth M D notifications@github.com wrote:

Hello,

I suppose it requires some sort of contractual binding to get full-access to software downloads. Please confirm. This is what I see from my login. Only the vEOS is available for download. [image: Inline image 1]

Regards, Shrikanth

On Sun, Dec 10, 2017 at 9:49 PM, ruferp notifications@github.com wrote:

I see it here: https://www.arista.com/en/support/software-download [image: screen shot 2017-12-10 at 12 46 52 pm] https://user-images.githubusercontent.com/8683589/ 33809232-75fb1988-dda8-11e7-96d1-2945a5da9be4.png

You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aristanetworks/EosSdk/issues/ 24#issuecomment-350580499, or mute the thread https://github.com/notifications/unsubscribe-auth/ AEtBEMvVZwhNfYwH94whMu6meW8THyBwks5s_EPEgaJpZM4NYS4G .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aristanetworks/EosSdk/issues/24#issuecomment-350639207, or mute the thread https://github.com/notifications/unsubscribe-auth/AJoBG9LUSLwyl0cRqnP3j2eLjw4i8mkjks5s_NTNgaJpZM4NYS4G .

theasianpianist commented 6 years ago

The FTP server is down again, can you fix it?