How to delete app and its code

As soon as this topic is not covered in the documentation, I would like to fire it up here. And yes, I’ve tried “viktor-cli clear” - it doesn’t help.
The problem: there is something stuck on Viktor’s side. The app keeps on showing me errors in files which are no longer exist in the code. As a free-account holder I can have only one app, right? So, whatever I post, it must override everything what was sent before, right?
How do I control in general what code exists on Viktor’s side? How can I be sure, that it deletes what I want to delete?

Hi @Dinosaver ,

You are indeed able to create multiple apps with the free version, when publishing these apps, there are some limitations depending on what type of apps you are building.

To get into your issue, first thing: viktor-cli clear is a command used to clear the database of the previously developed application within the Development workspace. This is needed for example when you are switching from one application that has a database (simple or tree-type app) to another app with a different type of database.

Having cleared that out (no pun intended :stuck_out_tongue_winking_eye: ), let us start by looking from where you are running your viktor-cli start. Let us assume that your new code resides in the directory:

C:\Users\dinosaver\viktor-apps\my_dinosaur_saving_app

Make sure to run the viktor-cli start command at the same directory, i.e.:

C:\Users\dinosaver\viktor-apps\my_dinosaur_saving_app> viktor-cli start

This should run the project that is running within that directory, more specifically either the app.py script, or the project defined within the app folder.

Could you check whether this helps?

Well, that’s exactly what I am doing. I am not sure I can start the app being in another directory. If it’s important, I use Ubuntu 22. I tryed to be in the same folder and change the code, then I tryed to create a new app from skratch and copy-paste my old app.py with the same app name, then a new app with different name - nothing works.
So, is there a way to at least see what is done on Viktor’s side? I can imagine a situation when I need to be entirely sure, that the code is complitely removed e.g. for legal reasons.
BTW, where are my previous apps? In my development environment I always see only one


Just to clarify, are you experiencing errors while developing, or as a published app? It is very important to make sure that all the files that you are referring to within your app logic is done as relative paths, and that the files are within the project. Here is an example of a relative path:

Also, as far as I am aware, you are allowed to have more than one app. You can create a new app on which you can publish by using the blue button in the app store with the label “Create app”:

You can check if the app is available for publication by using the command:

viktor-cli apps

To clarify your last question, while you are developing your application, your local code is generated into a web application that is rendered within your Development workspace. If you want to make this application shareable, you will need to publish the application. This is done as explained here:

The process will then make a copy of your code and send it to run in the cloud. To access this published application, you can create a workspace from the app. Once you’ve done this, you are able to share this with others.

Thank you for the detailed answer, but I am not that far. I only try to develop an app. During the run of the app in development workspace I receive errors, which I address in my code, stop the app, clear it, install again
 and it returns me the error in a .py file which I’ve just deleted.
Actually, yes, there was a mistake in file path, but now the file itself is gone and the wrong code as well. At least on my side, but it seems, not in Viktor.
Coming back to my question - there is no way to explicitly see what is deployed on Viktor? Not only what apps, but what code.

The platform logs all versions of the apps that get published, under the versions tab of an application (see an example of this with this link):

To know which tag refers to what code, for this we recommend using git. Git allows for code tagging, and the viktor-cli publish command checks whether a tag was created with git. This way, the developer can keep track of the code they developed, and to which version online it is linked.

But noting that you are still developing, I get the idea that this is not entirely what you were referring to, right?

Could you share the error that you are experiencing?

To clarify:

If you are developing an app, i.e. writing the code on your machine and using the viktor-cli to connect it to your development workspace, the app code runs on your local machine, receives jobs from the development workspace through the cli and sends back results. The code isn’t deployed on our infrastructure at this point.

When you are ready to publish (deploy as you mention above) your app, you can do this by following the publishing guide in our documentation. Only when performing this action your code is uploaded to our infrastructure.

Currently, it is not possible to completely delete the published app through the UI. If you want your app code removed please reach out to our support team (see the help menu in the interface) so we can do this for you.

Regards,

Raoul

Aha
 That’s clear.
Does it mean that the error messages come from my local interpreter? If yes, how on Earth it sees files which do not exist anymore
?
BTW, on Ubuntu it is not enough to select the path to python - it is always usr/bin. I have 2 Python versions and Viktor selects not the default one. You probably wanna look at this too.

That is a good question, did you by any chance try out both virtual environment and docker isolation modes? Or could it be that you have multiple instances of the CLI still connected to your development workspace?

Ok, this is a good test case. The code which returns the error, comes from a nuitka-packed file. I did not know that a packed file during execution tracks back the source code, which is very nice. And this is why the error message is the same as with not packed file. It is about missing system library libcblas.so.3 which is somehow needed by numpy packed with nuitka. After installation of the package libatlas-base-dev, all works.
The reason why I use nuitka is a package, which is available only from conda and not from pip. Any plans to support conda?

I do see Nuitka listed on PyPi

I just tried installing the package on Ubuntu with pip3 install Nuitka, which completes without any problems. It does require the capital ‘N’, which might be a bit uncommon.

Regards,

Raoul

Sorry, bad English. The reason why I use nuitka - is a package “pythonocc-core” which is available only from conda and not from pip.

So if I understand correctly you used Nuitka to compile some code that uses pythonocc-core. The resulting executable triggered some errors which showed the stack trace of the uncompiled code, which caused the confusion. By installing libcblas.so.3 you fixed that error, so now everything works as expected. Is that correct?:wink:

To get back to your question regarding Conda; we don’t have this planned in the near future as most Python packages are available on PyPi / can be installed with pip, since this is the official package manager of Python.

Keep in mind that once you publish your app it should also have the additional system library installed. You can instruct the publisher to do this by following the following instructions: Development tools & tips - Use system dependencies | VIKTOR Documentation

Yes, the confusion with error message is gone. It was not Viktor fault, but now I understand better how it works and kindly advise you to adjust the dokumentation.
About conda - ok, no problem, but be aware, that a very popular IFC library ifcopenshell needs pythonocc-core to process geometry.

hi @Dinosaver, I’m very much interested in your usecase. we see quite some opportunity to make this easier. can you help me out a bit on pinpointing where the exact limitations of using ifcopenshell within a VIKTOR app lie?

if i understand the above thread correctly ifcopenshell depends on pythonocc-core, which in turn does not provide a pip package and thereby blocks the possibility of using this in the app. (see this github issue)

however, i have an example VIKTOR application here that uses ifcopenshell without pythonocc-core without any problems.

is the pythonocc-core dependency only necessary in certain situations?

Hi @matthijs , soory for the delay, was in vacation.
Yes, occ-core is needed only when one wants to work with IFC geometry as with OpenCascade library. This is my case: I generate new geometry based on the existing one.
I have tryed to compile the occ part and call it as an external process or as a c+±based package, but there are much more problems with compilation of occ itself.
So, roughly speaking, the problem is not ifcopenshell but pythonocc-core whenever it’s needed.

Thanks for adding this. Is it in general necessary to use pythonocc-core when building up IFC files? Or only in specific circumstances?
The usecase in which we use ifcopenshell is reading out the IFC, which doesn’t seem to necessitate this.

Exactly, just reading does not need occ (well, again, if one does not want to read exact geometry, not just meshes). Only when one creates or modifies geometry and then wants to save it in IFC. If no geometry manipulation needed then writing IFC does not need occ.
But occ is not only about IFC, it is in general the only free library to work with 3D geometry. So, machinery, openings gemeration, clash detection etc. There are much more scenarios than IFC.

1 Like