Comments (15)
How's this?
https://singularityhub.github.io/sregistry/setup.html#roles
from sregistry.
Yes perfect! 👏
mmm only 2 more questions:
Can a superuser change the image ownership (programatically)?
Can a superuser change the image privacy (programatically)?
thanks!
from sregistry.
yes a superuser can do anything (akin to root) although it must be from the back end (the shell into the Docker image). A superuser thus could programmatically do either of those things.
from sregistry.
Ok, nice!
Where can I read about how to do that?
from sregistry.
Take a look here: https://docs.djangoproject.com/en/1.11/topics/db/queries/
shell into the image:
$ python manage.py shell
and then you can interactively test querying the models. For example:
$ from shub.apps.main.models import *
Container.objects.count()
container = Container.objects.last()
$ from shub.apps.users.models import User
user = User.objects.filter(username="vsoch")
collection = Collection.objects.filter(owner=user)
etc. How about give that a try, write down what you do, and post any trouble you have here. There are also scripts that you can write called management commands, under an application folder (eg, apps/main/management/commands) that then are run directly as scripts, eg:
python manage.py my_script
so if you have a common function that you want to do many times, that's the easiest way to do it. If it's something others would want I'd be happy to add to the global application (eg, this is like the script you used to create superusers and administrations) see here --> https://docs.djangoproject.com/en/1.11/howto/custom-management-commands/
ok I'm going back to sleep :)
from sregistry.
Thanks for the quick response as always!
Closing ...
from sregistry.
Sorry, a new one to be answered after sleep ...
Is possible to programatically get a user token?
from sregistry.
Yes, you would use the same lines in the function that generates the view, and then save it to file or print to screen from the management. What use case did you have in mind for this? Either way, the user would have to get something from you (in json) and save to his or her home folder, so it seems like extra work for you to do it (versus just giving them a link in the browser).
from sregistry.
Yeah ... I answer myself:
user = User.objects.get(username=options['username'])
user.token()
from sregistry.
woohoo! Yes I added a function to the user model, here --> https://github.com/singularityhub/sregistry/blob/master/shub/apps/users/models.py#L61 that points to this function --> https://github.com/singularityhub/sregistry/blob/master/shub/apps/users/utils.py#L34 that does a get or create sort of deal.
from sregistry.
It's a nice trick in django that functions associated with model objects can easily be added to the model class, and then available from the model without needing to add extra context variables to any view :)
from sregistry.
The use case is not completely clear, is why i'm trying different scenarios.
Some assumptions are:
- We have to provide public/private images
- Users will not interact with the Web UI
- Maybe only the admin interact and performs all actions
- Maybe the users can interact, but without being aware of the sregistry (orchestrater)
from sregistry.
Awake again? 😅
Great, thanks for clarifying! ... this is why it was so easy to find the solution. Thanks for your effort!
from sregistry.
Haha you keep re-opening the issue! I would first consider how you are doing authentication if the user isn't given access to the web UI. Perhaps try out the LDAP authentication that was just added? What you would want to do is have user accounts generated programmatically, then a script that generates the token files for the users for one or more accounts. Then you can add to their homes for them, or send in another way.
from sregistry.
Yes, one option is to interact from users account at the HPC ... (sure for pulling ... but not for pushing),
But other option is to push to SRegistry from an intermediate cloud layer without the need to now anything more than the user name (and maybe ssh keys - to think)
I will play with LDAP too, but first I think I'm going to reopen another issue 🤣
from sregistry.
Related Issues (20)
- docker compose error HOT 7
- sregistry under https HOT 5
- Error while pushing images HOT 20
- idea: spec out idea for builder operator
- Faulty date sorting HOT 1
- LDAP login: Python package jose missing, Python syntax error during login HOT 13
- Change local storage location HOT 6
- cannot start with docker compose HOT 1
- shub://* urls do not work HOT 11
- PLUGINS_ENABLED cannot be set in the settings.yaml file. HOT 1
- config.py is no longer there.
- hard coding SOCIAL_AUTH_GITLAB_SCOPE breaks auth. HOT 1
- Missing labels / container build recipes are not populated HOT 6
- NGINX Manifest unkown HOT 8
- Configuring base_url for sregistry when deployed behind an Apache reverse proxy on port 80 HOT 3
- Username Invalid token for Singularity CE endpoint HOT 5
- Connection Refused errors when pushing images HOT 6
- Is sregistry working with apptainer? HOT 1
- Images uploaded via web interface not found with Singularity pull HOT 6
- Push gives error 404 HOT 3
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 sregistry.