Comments (6)
Hi,
let's start with simple python program:
#!/usr/bin/env python3
print("Hello world!")
Now, you initialize isolate with
$ isolate --cg --init
It will print path to working directory of sandbox. Now you copy that python file (assume it's a.py
) into that path with additinal subdirectory box
. For example, could be /var/local/lib/isolate/0/box
. With this done, run that in isolate
$ isolate --cg --env=HOME=/home/user --run /usr/bin/python3 a.py
Python requires passing some enviroment variables. You can tweak that to fit your needs. It should print something like
Hello world!
OK (0.067 sec real, 0.081 sec wall)
Don't forget to cleanup the isolate sandbox
$ isolate --cg --cleanup
Please refer to original man page if you want up-to-date documentation, that url you provided may be a bit outdated.
from isolate.
Thanks for your quick response. It works as expected. Why does Python require $HOME environment variable?
from isolate.
For anybody out there reading this, I have created new issue regarding running Java programs and overhead in it: #14
from isolate.
Re python and the requirement of having HOME, we noticed the same in @cms-dev, see here - I suppose it is used to look for additional packages in ~/.local/lib/python... anyway, as you see in the link, we set it to the sandbox directory.
from isolate.
Thanks @stefano-maggiolo
from isolate.
🐂
from isolate.
Related Issues (20)
- Running Java program with a jar file HOT 20
- Thanks for maintaining and building this isolate environment. my question is, is it necessary to use docker for this isolated environment or can I also go with Linux Ec2 in AWS? HOT 1
- How to run dotnet in isolate? HOT 6
- Does the new cgv2 version of isolate need to be run as a privileged Docker container ? HOT 1
- open("/tmp/sandboxes/421/box/compile.output"): No such file or directory HOT 1
- isolate is significantly slower with CG enabled HOT 10
- java.lang.SecurityException: Can not initialize cryptographic mechanism
- Problem compiling cg2 branch code HOT 9
- Why privileged mode is required to run isolate in a docker container? HOT 2
- maxBuffer error occurs during isolate build. HOT 1
- Isolate does not link system directories HOT 1
- isolate-check-environment false negative for cgroup support HOT 1
- Outdated link to a2x in readme.md
- isolate memory accouting issue HOT 1
- Wrong memory usage when run program twice in one box HOT 1
- cg2 version fails if memory.swap.max does not exist HOT 7
- I also encountered the same issue. This worked for me:
- Getting Resource temporarily unavailable error while compiling C program HOT 3
- Is this possible? HOT 13
- cg2: `cf_cg_root` points to junk after `clone()` on Fedora HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isolate.