Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about plans on implementing AWS Backups #5547

Closed
w0rmr1d3r opened this issue Oct 10, 2022 · 12 comments 路 Fixed by #7231
Closed

Question about plans on implementing AWS Backups #5547

w0rmr1d3r opened this issue Oct 10, 2022 · 12 comments 路 Fixed by #7231

Comments

@w0rmr1d3r
Copy link

Hello @spulec and thank you for such an amazing project 馃殌

The issue I'm opening is not a bug, but I've looked for it if it had been asked before, and found nothing related to it. Only the item in the unimplemented list.

The question is:
Are there any plans in the short (or long) term on implementing AWS Backup?
Ref. boto3

Thank you again

@bblommers
Copy link
Collaborator

Hi @w0rmr1d3r! There are no plans yet, but I'll add it as an enhancement to add this feature. Which methods in particular did you want support for?

If this is something you want to tackle yourself, PR's are always welcome! See the contributing section in our docs if you need more info on how to get started with this.

@w0rmr1d3r
Copy link
Author

Hello @bblommers ,
Currently the methods to obtain backup job details.
Just wanted to make sure if there were plans or not on developing those features, so there weren't duplicated PRs or anything.
Don't have time right now, but will try to collaborate to this PR myself hopefully before 2023 馃

thank you for the guidance

@w0rmr1d3r
Copy link
Author

Hi @bblommers 馃憢
I was about to setup the repo in order to open the PR adding this functionality, but when I run make init it appeared this error:

Installed /Users/myusername/.pyenv/versions/3.11.0/envs/moto/lib/python3.11/site-packages/urllib3-2.0.0a2-py3.11.egg
error: urllib3 2.0.0a2 is installed but urllib3<1.27,>=1.21.1 is required by {'requests'}
make: *** [init] Error 1

Tried to figure out the error, but how the dependencies got managed confused me. Also, I saw this other issue #4113 which might be related on how to improve this.

What's the best way to fix this issue so I can open the PR to add this functionality?

Thank you

@bblommers
Copy link
Collaborator

Interesting. Looks like this is due to pypa/setuptools#855, and it would definitely be fixed by implementing our #4113.

I believe the equivalent pip-only installation is:

pip install --editable .[all]
pip install -r requirements-dev.txt

@w0rmr1d3r
Copy link
Author

Weird.
I tried this:

pip install --editable .[all]

And this is the outcome:

zsh: no matches found: .[all]

However, the second line, to install requirements-dev, worked!
Was able to run make test but failing at the linting:

[...] Previous steps worked

Running MyPy...
mypy --install-types --non-interactive
moto/core/custom_responses_mock.py:15:5: error: Name "version" already defined (possibly by an import)  [no-redef]
Found 1 error in 1 file (checked 171 source files)
make: *** [lint] Error 1

It seems that mypy doesn't like this:
https://github.com/spulec/moto/blob/master/moto/core/custom_responses_mock.py#L15

So, I ran separately make test-only and it seems to work so far (some tests pass, others don't, but I believe it's due to the setup not being complete).
Will keep you posted if I found any other issue 馃憤

@bblommers
Copy link
Collaborator

bblommers commented Dec 9, 2022

zsh is a bit peculiar - you might have to use pip install ".[all]" (with quotes)

@w0rmr1d3r
Copy link
Author

Indeed the command with the quotes worked.
Still raising the mypy.

Was able to start the backup service and this happened:

Select Operation: list_tags
	Initializing service	backup
	creating	moto/backup
	creating	moto/backup/models.py
	creating	moto/backup/exceptions.py
	creating	moto/backup/__init__.py
	creating	moto/backup/responses.py
	creating	moto/backup/urls.py
	creating	tests/test_backup
	creating	tests/test_backup/__init__.py
	creating	tests/test_backup/test_server.py
	creating	tests/test_backup/test_backup.py
	inserting code	moto/backup/responses.py
Traceback (most recent call last):
  File "/Users/ramonguimera/Documents/w0rmr1d3r-repos/moto/scripts/scaffold.py", line 689, in <module>
    main()
  File "/Users/ramonguimera/.pyenv/versions/moto/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ramonguimera/.pyenv/versions/moto/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/ramonguimera/.pyenv/versions/moto/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ramonguimera/.pyenv/versions/moto/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ramonguimera/Documents/w0rmr1d3r-repos/moto/scripts/scaffold.py", line 669, in main
    insert_codes(service, operation, api_protocol)
  File "/Users/ramonguimera/Documents/w0rmr1d3r-repos/moto/scripts/scaffold.py", line 619, in insert_codes
    insert_code_to_class(responses_path, BaseResponse, func_in_responses)
  File "/Users/ramonguimera/Documents/w0rmr1d3r-repos/moto/scripts/scaffold.py", line 541, in insert_code_to_class
    mod = importlib.import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ramonguimera/.pyenv/versions/3.11.0/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'moto.backup'

Should that happen for a service that isn't in moto yet?

@bblommers
Copy link
Collaborator

Ah, I realize my command didn't have the --editable argument - that part is necessary for the scaffold-script to install new services.
The scaffold-script creates all necessary files for the new module on the fly, and then loads the module dynamically. But that only works if pip does an editable install.

@bblommers
Copy link
Collaborator

Hi @w0rmr1d3r, did you manage to get this working in the end?
Let me know if you need any help - happy to have a go and help implement this feature.

@w0rmr1d3r
Copy link
Author

Hello @bblommers ,
I've been focused on other things, apologies for not taking care of this issue.
I'll try to give it a second chance this April 馃憤

@archinksagar
Copy link
Contributor

Hello @bblommers @w0rmr1d3r ,
Is AWS Backup implementation still in progress because I see that the last comment on this issue was April? I need AWS Backup in Moto, I am planning to implement it if its not already started.

@w0rmr1d3r
Copy link
Author

hi @archinksagar ,
I never found a time to implement it. From my side, feel free to start it.
Apologies for not giving this enough time from my side.

@bblommers bblommers linked a pull request Jan 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants